* Add zeroBaseFee config for all consensus types
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Use ZeroBaseFeeMarket when zeroBaseFee is set
Introduce ZeroBaseFeeMarket overriding computeBaseFee with 0
Wire ZeroBaseFeeMarket into MainnetProtocolSpecs.londonDefinition when zeroBaseFee set
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Fix BaseFeeMarketBlockHeaderGasPriceValidationRule to allow syncing to work
Without this, rule would fail if syncing a chain with a non-zero baseFee
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Fix fast sync invalid block error
Occurred while testing clique in scenario where londonFork had a non-zero base fee, but zeroBaseFee flag was used to sync
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Update changelog
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Address review comments: Remove startup log
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Address review comments: replace isForkBlock with validationMode
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Address review comments: replace ZeroBaseFeeMarket instance check with validationMode
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Fix changelog
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Split validationMode into baseFeeValidationMode and gasLimitValidationMode
Since behaviour needs to differ between BaseFeeMarketBlockHeaderGasPriceValidationRule and GasLimitRangeAndDeltaValidationRule
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Update changelog
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* interprete an empty string (0x80) as an unsigned byte of 0
Signed-off-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* Refactor retrying peer task switching peers at every try
RetryingGetBlockFromPeersTask had a problem that prevented to complete
when all the peers were tried without success, and that also had the
consequence to not removing the failed requested block for the internal
caches in BlockPropagationManager, that could cause a stall since that
block will to be tried to be retrieved again.
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* if merge enabled, wrap two clique rules in composed Attached rule to enable fast-sync to proceed normally for post-merge networks
* move BlockPropagationManager warning to debug until #4274
Signed-off-by: garyschulte <garyschulte@gmail.com>
* Add more log to retrieve parent method
* Request the lowest pending ancestor when saving a block
* Replace recursive implementation with iterative when getting pending ancestors of Block
* Decrease scope of synchronized block to reflect only the event of adding pending block to the list
* Add fork to the chain so test is more representative
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
* correct fallback ttd to correct value
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* on block propagation stop, only kill the new block and new block hash handlers, leave all others (especially txs) alone
Signed-off-by: Justin Florentine <justin+github@florentine.us>
If a response to the get header P2P request only returns the header that
is the start of the range we may need to trim it to an empty response,
this is breaking the validation response. One client has started
returning only the range header start in some circumstances (which is a
valid response per spec). Because we sometimes request an overlapping
header this results in an empty stream once we cut the duplicates.
fixes#3336
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* ignore 2 tests that assume that the system language is English, if that should not be the case
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* After merge add a rule to check that the current block is more recent than its parent
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Update CHANGELOG
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Unit test
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Return of lastest valid hash in case of bad block
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Add CHANGELOG entry
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Remove now unused method
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Revert changes to backward sync, since not needed for this fix
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Adapt new test coming from the rebase with main
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Unit tests
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* ignore forkchoice update if new head is an ancestor of the chain head
* added draft for CHANGELOG.md
* update PR link for CHANGELOG.md
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* If terminal block is present in the genesis, then peers must have it
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Update unit test
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* address review comments
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>