Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R4R]apply max commit tx time for miner worker #112

Merged
merged 2 commits into from
Mar 19, 2021
Merged

Conversation

unclezoro
Copy link
Collaborator

@unclezoro unclezoro commented Mar 15, 2021

Description

The miner worker together with parlia consensus has a defect that if the previous validator produces a large block or propagate the block to the next validator later than 3 seconds, if the next validator still tries to include tx as much as possible, it will eventually produce an empty block. This PR target to solve this issue.

Rationale

We add a new interface of consensus engine: Delay(), which is special designed for the consensus engine that has a fixed blocking time. If the miner is working on commit tx and found that it reach the Delay()-delayLeftOver time, it will stop commit tx and seal a block, so that the empty block can be avoid.

Example

an new option is added:

--miner.delayleftover 50000000

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

@unclezoro unclezoro force-pushed the maxCommitTime branch 2 times, most recently from c5df913 to 1842e15 Compare March 15, 2021 08:19
@unclezoro unclezoro force-pushed the maxCommitTime branch 4 times, most recently from 1b34032 to f1991a5 Compare March 16, 2021 02:50
@unclezoro unclezoro changed the title [WIP]apply max commit tx time for miner worker [R4R]apply max commit tx time for miner worker Mar 16, 2021
@unclezoro unclezoro changed the base branch from master to develop March 18, 2021 07:35
@unclezoro unclezoro merged commit f8faf7f into develop Mar 19, 2021
@unclezoro unclezoro mentioned this pull request Mar 23, 2021
3 tasks
@unclezoro unclezoro deleted the maxCommitTime branch March 23, 2021 07:18
unclezoro added a commit to unclezoro/bsc that referenced this pull request Apr 13, 2021
add consensus engine Parlia implement

add async write rotate log handler

add precompile light client contracts

prepare for release 1.0.0-alpha.0 for Rialto network #1

Signed-off-by: fudongbai <[email protected]>

add key features to the readme

update 'running a node' part of readme (#2)

more strick condition for system transaction

add gov init transaction

fix validator failed to sync a block produced by itself

update stale depth

add gas limit check in parlia implement

remove redundant gaslimit check

fix debug_traceTransaction crashed issue (bnb-chain#13)

add bep2p tokens for faucet (#5)

add cross chain contract to system contract

allow slash failed (bnb-chain#15)

update metaversion to beta.0

add changelog for v1.0.0-beta.0

add chain id into sign bytes to avoid replay attack (bnb-chain#18)

reestimate the gas consumption for system tx when there is 41 validators (bnb-chain#19)

prepare for 1.0.0-beta.1 (bnb-chain#20)

resolve best practice advice

enforce backoff time for out-turn validator (bnb-chain#23)

framework for upgrade system contract

improve upgrade config

refactor upgrade config

add beforeUpgrade and afterUpgrade

add multiple upgrade config

resolve comment

add upgrade height for rialto

fix deplay check

fix hex code of new smart contract

fix index out of range

fix not return error when blockTimeVerifyForRamanujanFork failed

update chapel ramanujan fork

prepare for release 1.0.1-beta

add niels fork

eth/tracers: revert reason in call_tracer + error for failed internal calls (#21387)

* tests: add testdata of call tracer

* eth/tracers: return revert reason in call_tracer

* eth/tracers: regenerate assets

* eth/tracers: add error message even if no exec occurrs, fixes #21438

Co-authored-by: Martin Holst Swende <[email protected]>

remove disclaim

prepare for release 1.0.2

R4R: add max gas allwance calculation (bnb-chain#36)

* calculate max gas allwance

* return error for missing from

prepare release 1.0.3

use fixed gas price since bsc network is idle

upgrade to golang1.15.5

Disable noisy log from consensus engine

Hide some smart contract tracing logs from parlia consensus engine

Create PULL_REQUEST_TEMPLATE

add change log for release v1.0.4

add curl in docker image

les: fix GetProofsV2 bug (#21896)

fix potential deadlock of pub/sub module

add rpc method request gauge

add x-forward-for message in log

support fork id in header; elegant upgrade

avoid false warn log

consensus/ethash: use 64bit indexes for the DAG generation (#21793)

* Bit boundary fix for the DAG generation routine

* Fix unnecessary conversion warnings

Co-authored-by: Sergey Pavlov <[email protected]>

signer/storage: fix a badly ordered error check (#21379)

core: fix txpool off-by-one error (#21683)

internal/ethapi: fix nil deref + fix estimateGas console bindings (#21601)

* tried to fix

* fix for js api

* fix for nil pointer ex

* rev space

* rev space

* input call formatter

rpc: fix issue with null JSON-RPC messages (#21497)

accounts/abi: fix a bug in getTypeSize method (#21501)

* accounts/abi: fix a bug in getTypeSize method

e.g. for "Tuple[2]" type, the element of the array is a tuple type and the size of the tuple may not be 32.

* accounts/abi: add unit test of getTypeSize method

p2p/enode: avoid crashing for invalid IP (#21981)

The database panicked for invalid IPs. This is usually no problem
because all code paths leading to node DB access verify the IP, but it's
dangerous because improper validation can turn this panic into a DoS
vulnerability. The quick fix here is to just turn database accesses
using invalid IP into a noop. This isn't great, but I'm planning to
remove the node DB for discv5 long-term, so it should be fine to have
this quick fix for half a year.

Fixes #21849

p2p/discover: fix deadlock in discv5 message dispatch (#21858)

This fixes a deadlock that could occur when a response packet arrived
after a call had already received enough responses and was about to
signal completion to the dispatch loop.

Co-authored-by: Felix Lange <[email protected]>

R4R: apply mirror sync upgrade (bnb-chain#56)

* apply mirror sync upgrade

remove 0x

update rialto genesis hash

update tokenhub code

* update tokenhub code

* update relayer incentive contract code

* update upgrade height and remove mainnet upgrade

prepare for release v1.0.5 (bnb-chain#64)

[R4R]appay mirror/sync fork to main-net; release for 1.0.6 (bnb-chain#68)

* appay mirror/sync fork to main-net; release for 1.0.6

* fix upgrade do not work

change the fork waring to debug to avoid confusion (bnb-chain#73)

add jq to docker file (bnb-chain#84)

add tini for docker image (bnb-chain#90)

Co-authored-by: swift.du <[email protected]>

add directbroadcast flag (bnb-chain#99)

limit range get log

R4R: add batch query methods (bnb-chain#115)

* add batch query method

* GetTransactionDataAndReceipt

* add new rpc to goclient

* fix web3 console

* rename tx_data to txData

[R4R]apply max commit tx time for miner worker (bnb-chain#112)

* apply max commit tx time for miner worker

* update to 200 ms

validator only write database state when enough distance (bnb-chain#116)

add health check endpoint (bnb-chain#120)

prepare for release v1.0.7

update receiptsCacheLimit to 10000
vietthang207 pushed a commit to KyberNetwork/bsc that referenced this pull request May 11, 2021
* apply max commit tx time for miner worker

* update to 200 ms
minh-bq pushed a commit to minh-bq/ronin that referenced this pull request Dec 30, 2022
This commit adapts BSC PR: bnb-chain/bsc#112 to Ronin.

An empty block is pre-sealed by default. It's expected that a new block with
transactions is committed and abort the empty block producer if there are
pending transactions. However, with the low block time, in case there are a lot
of pending transactions, the commit transactions time exceeds the time an empty
block is produced. As a result, block with transactions is not produced but an
empty block and no real transactions is mined.
minh-bq pushed a commit to minh-bq/ronin that referenced this pull request Dec 30, 2022
This commit adapts BSC PR: bnb-chain/bsc#112 to Ronin.

An empty block is pre-sealed by default. It's expected that a new block with
transactions is committed and abort the empty block producer if there are
pending transactions. However, with the low block time, in case there are a lot
of pending transactions, the commit transactions time exceeds the time an empty
block is produced. As a result, block with transactions is not produced but an
empty block and no real transactions is mined.
minh-bq pushed a commit to minh-bq/ronin that referenced this pull request Jan 4, 2023
This commit adapts BSC PR: bnb-chain/bsc#112 to Ronin.

An empty block is pre-sealed by default. It's expected that a new block with
transactions is committed and abort the empty block producer if there are
pending transactions. However, with the low block time, in case there are a lot
of pending transactions, the commit transactions time exceeds the time an empty
block is produced. As a result, block with transactions is not produced but an
empty block and no real transactions is mined.
minh-bq pushed a commit to minh-bq/ronin that referenced this pull request Jan 6, 2023
This commit adapts BSC PR: bnb-chain/bsc#112 to Ronin.

An empty block is pre-sealed by default. It's expected that a new block with
transactions is committed and abort the empty block producer if there are
pending transactions. However, with the low block time, in case there are a lot
of pending transactions, the commit transactions time exceeds the time an empty
block is produced. As a result, block with transactions is not produced but an
empty block and no real transactions is mined.
minh-bq pushed a commit to minh-bq/ronin that referenced this pull request Jan 16, 2023
This commit adapts BSC PR: bnb-chain/bsc#112 to Ronin.

An empty block is pre-sealed by default. It's expected that a new block with
transactions is committed and abort the empty block producer if there are
pending transactions. However, with the low block time, in case there are a lot
of pending transactions, the commit transactions time exceeds the time an empty
block is produced. As a result, block with transactions is not produced but an
empty block and no real transactions is mined.
minh-bq added a commit to axieinfinity/ronin that referenced this pull request Jan 16, 2023
)

This commit adapts BSC PR: bnb-chain/bsc#112 to Ronin.

An empty block is pre-sealed by default. It's expected that a new block with
transactions is committed and abort the empty block producer if there are
pending transactions. However, with the low block time, in case there are a lot
of pending transactions, the commit transactions time exceeds the time an empty
block is produced. As a result, block with transactions is not produced but an
empty block and no real transactions is mined.
galaio pushed a commit to galaio/bsc that referenced this pull request Jul 31, 2024
galaio pushed a commit to galaio/bsc that referenced this pull request Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants