* aggresively seeking out other places to defend from this
Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
* Remove log statements that are keeping references to objects for too much time
Improvement in terms of reducing java heap used,
since the logs were keeping reference to blocks sent by newPayload,
that causes high memory consumption during initial sync,
and could be one of the causes that prevent to complete snap sync on low spec machines.
Exceptions are also logged by the backward sync, so there is no loss of information.
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Implement "Small" EOF - EIP-3540 (container) and EIP-3670 (validation).
Make code an interface so EOF specific features are compartmentalized,
including an 'invalid' code type representing a code block that didn't
pass validation, CodeV1 for EOF1, and CodeV0 which represents pre-EOF
code. EVMs track a maximum supported EOF version (where 0 is pre-eof)and
code is generated from a CodeFactory taking in context (is it a CREATE
operation and max code size) for the validation.
Includes spec versions for "Shanghai" and transient testnet "Shandong".
"Small" EOF is only activated in Shandong.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* Rename fastSyncEnabled to fullSyncDisabled and pass syncConfig down instead of boolean
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* Fix tests references
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* Fix class references
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
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>
Due to subtle differences between Bytes32 and UInt256 the changes failed
burn-in testing and are being reverted.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* don't add to bad blocks manager on StorageException
* support for MerklePatriciaTrie exceptions
Signed-off-by: Justin Florentine <justin+github@florentine.us>
* re-emits correct block added event when reminding
* uprevs version of log bloom cache metadata to force regeneration on startup
Signed-off-by: Justin Florentine <justin+github@florentine.us>
* Refactor unverified forkchoice event
Renaming to make clear everywhere that the forkchoice is not verified, so
it will be clear in case there will be a future event for a verified forkchoice.
Finalized block hash no more optional.
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Replace boolean return with BlockImportResult object
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
* Add more tracing logs to transaction pool
* Prevent adding non executable transactions and evict based on age
* Move sender account in TransactionsForSenderInfo
* Implement a size expiration cache for lowest invalid nonce for sender
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
* Retry mechanism for block creation
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Update CHANGELOG
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Always keep 1 thread active in the computation executors
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Surface StorageException when building a block for finer filtering
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Log successful block created at info
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Reformat block proposal logs
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Remove test code
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* refactors to rely on blocks added, and behave like singleton
* pulls up synchronizer building to keep merge related stuff in right place
* shows ready on pre-merge nets. no display on most merge nets
* listens for finalized, explains more pandas
Signed-off-by: Justin Florentine <justin+github@florentine.us>
* evict transactions from tail of senderAndNonce rather than just lowest price
* make pendingTransactions secondary sort based on timestamp rather than sequence id (to better prevent collisions for same gas price and sequence id)
Signed-off-by: garyschulte <garyschulte@gmail.com>
* 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>
* initial impl of engine-api override:
* remove reliance on isMergeEnabled in pre-merge block header validation rules
* create a merge-specific block header validtion stack rather than leveraging mainnet
* re-add --engine-api-enabled cli param
* make engine api usable without a merge config.
leaves the door open to supporting the engine api with other MiningCoordinators, but disables all but engine_exchangeTransitionConfiguration in the absence of mergeCoordinator
Signed-off-by: garyschulte <garyschulte@gmail.com>
* fix infinite loop if a reorg contain a bad block
* add cache for latest valid ancestors for bad blocks
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* add a merge-specific definiton of bestPeer and the supporting plumbing
Signed-off-by: garyschulte <garyschulte@gmail.com>
* set reached TTD when finishing a fast sync if appropriate
Signed-off-by: garyschulte <garyschulte@gmail.com>
* spdx header
Signed-off-by: garyschulte <garyschulte@gmail.com>
* fix BetterSyncTargetEvaluatorTest tests
Signed-off-by: garyschulte <garyschulte@gmail.com>
* adds interfaces for tracking merge state and forchoices
* after 2 finalizations from fcu, disconnect any peers sending new blocks, or connecting with td > ttd
* tests for preventing pow peers from joining
* refactored to separate out merge logic
Signed-off-by: Justin Florentine <justin+github@florentine.us>
* 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>
* 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>
* fix for TransitionProtocolSchedule getByBlockHeader when the chain is not finalized AND terminal block was exactly TTD
Signed-off-by: garyschulte <garyschulte@gmail.com>
* make invalid timestamp error return success response with INVALID status
* fix newPayloadTest expectation for invalid timestamp, add check in bad blocks for heads not in blockchain, return Hash.ZERO for latest valid ancestors that are PoW
* assert latestValidHash returns ZERO if PoW and ancestor hash if not.
Signed-off-by: garyschulte <garyschulte@gmail.com>
* When executing a newPayload do not move the chain head or update the world state
* When proposing a block, use a lightweight validation, without storing
* forwardToBlock moves head to the block and triggers advanced head event
* Do not persist prepared blocks
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Karim TAAM <karim.t2am@gmail.com>
* removed check from fcU if new blocks are descendants of the previous finalized block
* backwards sync: remove check that block must be a descendant of finalized
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>