Skip to content

Commit

Permalink
Migrating PeerDAS to Fulu (#163)
Browse files Browse the repository at this point in the history
* Upgrade acceptance tests flakiness fix (Consensys#8635)

* start EL and CL pair together to avoid delay
* give and extra 30 secs to genesis

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>

* removed consolidations signing domain for electra (Consensys#8638)

This is no longer required, cleaning up.

fixes Consensys#8636

Signed-off-by: Paul Harris <[email protected]>

* Update network file (Consensys#8631)


Signed-off-by: gconnect <[email protected]>
Co-authored-by: Paul Harris <[email protected]>
Co-authored-by: Gabriel Fukushima <[email protected]>

* Add deposit chainId to network file on start (Consensys#8639)

* Update CHANGELOG.md to mention new p2p flood publish param (Consensys#8633)

Co-authored-by: Gabriel Fukushima <[email protected]>

* Introduces `SchemaRegistry` and related classes (Consensys#8614)

* Implement a DatabaseArchiveWriter and add to pruneOldestBlobSidecars (Consensys#8640)

* Implement a DatabaseArchiveWriter and add to pruneOldestBlobSidecars. Currently not configurable and only implements a NoopWriter.

* Moving requests out of ExecutionPayload (Consensys#8600)

* Update Electra penalty computation. EIP7125 (Consensys#8612)

Update Electra penalty computation.

* Add fix for CVE-2024-7254 (Consensys#8647)

* FIx codespell check (Consensys#8652)

* Upgrade jc-kzg-4844 to latest version (Consensys#8651)

* Add schema registry in schema definitions (Consensys#8615)

* feat: LUKSO Mainnet Dencun Hardfork (Consensys#8650)

* Add LUKSO Deneb activation to CHANGELOG (Consensys#8654)

* Fix blockImportCompleted (Consensys#8653)

* Add get-earliest-available-block-slot to debug tool (Consensys#8649)

* add get-earliest-available-block-slot to debug tool

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>

* Gossip_V_1_2 (IDONTWANT) (Consensys#8648)

* Gossip_V_1_2

* changelog

---------

Co-authored-by: Stefan Bratanov <[email protected]>

* Enable enr field in GetPeers and GetPeerById (Consensys#8641)

* Expose discovery NodeId to DiscoveryPeer and LibP2PPeer (#38)
* Add DiscoveryPeer.getNodeId()
* Add Eth2Peer.getDiscoveryNodeId() method.
* Refactoring, discovery updated to 24.9.1
---------

Co-authored-by: Anton Nashatyrev <[email protected]>

* Disable flood publish by default and hide flood param (Consensys#8661)

* Added executionRequestsHash to EngineNewPayloadV4 (Consensys#8666)

* Removing ExecutionPayloadV4 (Consensys#8667)

* add engine get blobs (Consensys#8662)

* add engine get blobs

* Adopt `engineGetBlobs` (Consensys#8663)

* initial implementation

* improve

* better debug logging

* improve tests

* better error handling

* better error msg

* add changelog line

* missed toString change

* Remove redundant method from the Database interface (Consensys#8657)

Signed-off-by: Gabriel Fukushima <[email protected]>

* Mark local-el retrieved blobs as seen WRT gossip equivocation cache (Consensys#8675)

* Creating PendingDeposit container (Consensys#8678)

* Updated presets for EIP-6110 (Consensys#8679)

* add rpc method return type checks in unit tests (Consensys#8677)

* add rpc method return type checks in unit tests

* tmp

* EIP-6110: Queue deposit requests and apply them during epoch processing (Consensys#8681)

* spotless fixes

* Switch to compounding when consolidating with source==target (Consensys#8646)

* Refactored externalSigner to use Typedefs (Consensys#8541)

 - created a new suite of tests to show a number of different signing bodies.
 - had to do manual testing for external signer becuase no AT i think
 - I was able to get from phase0 -> bellatrix so this should cover most scenarios.
 - I believe most of the wrappers should be available in the api

partially addresses Consensys#8527

Signed-off-by: Paul Harris <[email protected]>

* Cleaning up (Consensys#8683)

* Check network on start and reset db (Consensys#8642)

Signed-off-by: gconnect <[email protected]>
Co-authored-by: Paul Harris <[email protected]>

* Implemented decoding and hash rules for execution requests (Consensys#8668)

* reset changelog (Consensys#8685)

* fix proposer config loader (Consensys#8687)

* fix proposer config loader

* Fix: Partial withdrawals count (Consensys#8684)

* changing max pending partial withdrawals per sweep according to spec for minimal and swift
* fix partial pending withdrawals count
* bump reference test to alpha.8

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>

* clear changelog (Consensys#8690)

* middle of fixes

* Migrate Attestation and AttnetsENR schemas to registry (Consensys#8692)

* migrate Attestation and AttnetsENR schemas to registry

* allow `addMilestoneMapping` with same `milestone` and `untilMilestone`

* Cleanup JsonProvider and unused serializers (Consensys#8689)

Signed-off-by: Paul Harris <[email protected]>

* move deserializers that we use from api schema (Consensys#8699)

Signed-off-by: Paul Harris <[email protected]>

* Updated GetPayloadV4 with executionRequests decoding (Consensys#8698)

* Add executionRequestHash to NewPayloadRequest as part of block validation flow (Consensys#8700)

* Refactor ExecutionPayloadResult (Consensys#8702)

* Check that ExecutionRequests is not null in block body (Consensys#8697)

Co-authored-by: Lucas Saldanha <[email protected]>

* Exclude old incompatible jc-kzg-4844 artefact (Consensys#8704)

* in the middle of finals everywhere

* Updated NewPayloadV4 to send requests instead of hash (Consensys#8710)

* Organize Electra schemas more logically (Consensys#8708)

* Remove old execution requests from execution payload (Consensys#8707)

* Add functions for execution requests to block body (Consensys#8706)

* Reduce wait period to avoid flakiness (Consensys#8701)

* reduce wait period to avoid flakiness

Signed-off-by: Gabriel Fukushima <[email protected]>

* Reduce parallelism for ATs

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>

* Another finals session

* more finals

* Fix two small nits dealing with deposits (Consensys#8713)

* Fix isFullExitRequest return (Consensys#8709)

Co-authored-by: Paul Harris <[email protected]>

* Remove unused methods on ExecutionPayloadBuilder (Consensys#8718)

* Updated BlockOperationSelectorFactory to include execution requests post-Electra (Consensys#8717)

* [Builder API] Update for Electra spec (Consensys#8721)

* Fix engine_newPayloadV4 executionRequests serialization (Consensys#8723)

* middle of spotlessApply fixes

* Schema registry interface improvement (Consensys#8696)



Co-authored-by: Enrico Del Fante <[email protected]>

* Add `forceLowercase` in `enumOf` (Consensys#8724)

* More finals and fixes

* Move processWithdrawalRequests to BlockProcessorElectra (Consensys#8711)

* remove test fixed from the list of ignored tests
* move processWithdrawalRequests to BlockProcessorElectra
* expose supplier so it can be accessed from ElectraBLockProcessor

---------

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add debug command to retrieve peerId from a node key file (Consensys#8727)

* Add debug command to retrieve peerId from a node key file

Signed-off-by: Gabriel Fukushima <[email protected]>

* spotless

Signed-off-by: Gabriel Fukushima <[email protected]>

* add default flags to command

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>

* More finals

* migrate all schemas in AbstractSchemaDefinitions (Consensys#8726)

* Create file system based BlobSidecar data archive (Consensys#8674)

Add the option --Xdata-storage-blobs-archive-path to allow pruned BlobSidecars to be written to disk. Each block/slot has all associated BlobSidecars written to disk in a filename of the block root hash and written out in JSON format.

* 8525 beacon states cleanup (Consensys#8725)

* set up state pruner when switching from archive to minimal or prune mode

* update EL get blobs logs wording (Consensys#8729)

* update EL get blobs logs

* Fix missing Gossip subnet subscription on startup (Consensys#8730)

* update to latest release of tuweni. Switch from org.apache to io.tmio (Consensys#8712)

Co-authored-by: Enrico Del Fante <[email protected]>

* Next batch of finals + GossipForkSubscriptions for EIP7594 (a bit hacky with TODO)

* make state pruner faster (Consensys#8734)

* make state pruner faster

* Update build.gradle to support nightly reference tests (Consensys#8732)

Co-authored-by: Lucas Saldanha <[email protected]>

* Standardise the Engine JSON-RPC error codes (Consensys#8695)

Co-authored-by: Lucas Saldanha <[email protected]>
Co-authored-by: Enrico Del Fante <[email protected]>

* little more

* final build fixes

* fix some tests

* More test fixes

* Checking correctness merging of master (from beginning to infrastructure module)

* In WithdrawalRequest, rename validatorPublicKey to validatorPubkey (Consensys#8744)

* Move getMaxEffectiveBalance to MiscHelpers (Consensys#8714)

* Implemented engine_forkchoiceUpdatedV4 (Consensys#8748)

* Migrate attester slashing and indexed attestation to schema registry (Consensys#8736)

* migrate-attester-slashing-and-indexed-att

* fix tests

* remove SchemaDefinitionCache from rest builder client (Consensys#8693)

* Eth-Consensus-version header now passed for json block production from VC (Consensys#8754)

When producing a block, JSON payloads require the Eth-Consensus-version header.

Generally using SSZ this was correct, but there was no test case for JSON block production, and it wasn't providing the header correctly.

Because probably 99% of our block production is via SSZ, this was not really visible.

This would not be a problem for local BN+VC, but if the teku VC ever falls back to json (or is instructed to produce JSON), block production could potentially fail if the BN is following spec.

Changed an AT to check both SSZ and JSON block production.

fixes Consensys#8753

Signed-off-by: Paul Harris <[email protected]>

* Expanded VC API tests (Consensys#8757)

fixes Consensys#8756

Added test cases for VC block requests, and added a validation to the Attestation request test. These were the 2 VC cases where we now require that header to be specified or we will fail.

There was another case in DSL for AT, but we'll see those quickly if we use it.

Signed-off-by: Paul Harris <[email protected]>

* master merge final verification

* made post block header work with available information (Consensys#8758)

In the case of JSON specifically, we do have the slot number, and we don't actually need the header with a slot present.

Signed-off-by: Paul Harris <[email protected]>

* apis tests (Consensys#8760)

* add http client unit tests

* fix fixture (as order of block generation was changed)

* Change order of electra presets to match spec (Consensys#8762)

Co-authored-by: Lucas Saldanha <[email protected]>

* Add electra types to schema interfaces (Consensys#8761)

Co-authored-by: Lucas Saldanha <[email protected]>

* Enable more errorprone experimental checks (Consensys#8763)

* Save earliest slot block in a DB variable (Consensys#8722)

Adding a variable in the database to store the earliest available block slot which is used when peers request blocks by range. This is a query that can vary in some case and I've seen it causing disconnection in some cases due to multiple requests getting timed out. Changing it to be stored in a variable brings the query to 1 - 2 ms response time. It does add a bit of logic to handle the sync of historical batches and prune which are currently the workflow in the code base that affect that column family.

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>

* Update a two tests files that contain deprecated methods. (Consensys#8765)

* fix test with DebugDataDumper

* Aggregate and proof in schema registry (Consensys#8770)

* Change the builderResultCache of ExecutionLayerBlockProductionManagerImpl (Consensys#8766)

Change the builderResultCache of ExecutionLayerBlockProductionManagerImpl keys from slot to SlotAndBlockRoot. This allows the cache to return proposals based on slot and block root, which is required if there's multiple operators requesting different beacon block proposals.

fixes Consensys#8625

* add post block integration tests (Consensys#8771)

* refactor post block integration tests

* refactored logging for inclusion on gossip channels. (Consensys#8733)



---------

Signed-off-by: Paul Harris <[email protected]>
Co-authored-by: Enrico Del Fante <[email protected]>

* Produce block only once for a slot (Consensys#8773)

* cleanup EphemeryNetwork and add max slot constant (Consensys#8778)

fixes Consensys#8777

Signed-off-by: Paul Harris <[email protected]>

* Add BlobSidecar inclusion proof verification in req/resp (Consensys#8775)

* Upgrade `jvm-libp2p` to 1.2.1 (Consensys#8783)

* Add explicit tie-breaker in pending balance deposits sort (Consensys#8772)

Co-authored-by: Enrico Del Fante <[email protected]>

* Tiny `getTopic` optimization (Consensys#8776)

* Fixed early peerDAS actions in deneb

* Expose gossip future (Consensys#8735)

* Rename some variables associated with AttestationElectra (Consensys#8788)

* Rename validateable to validatable (Consensys#8784)

Co-authored-by: Enrico Del Fante <[email protected]>

* Various cleanups (Consensys#8791)

* Update FuzzUtil to Electra (Consensys#8792)

* Refactor BeaconStateSchema.getUniqueFields() methods (Consensys#8789)

Co-authored-by: Enrico Del Fante <[email protected]>

* Cleanup 24.10.3 (Consensys#8794)

* create EphemerySlotValidationService and test (Consensys#8759)

Signed-off-by: gconnect <[email protected]>
Co-authored-by: Paul Harris <[email protected]>

* add start scripts to correctly detect jemalloc presence (Consensys#8751)

* add start scripts to detect jemalloc presence

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>

* pass asyncRunner to builder (Consensys#8798)

Signed-off-by: Gabriel Fukushima <[email protected]>

* use the correct schema definitions (Consensys#8797)

* use the correct schema definitions

* update deposit snapshot november 2024 (Consensys#8809)

Signed-off-by: Gabriel Fukushima <[email protected]>

* Fix parameter name for forkchoiceUpdatedV4 (Consensys#8811)

* Change blindedBlockCreatorCache keys from slot to slotAndBlockRoot. (Consensys#8780)

Co-authored-by: Stefan Bratanov <[email protected]>

* Decouple block and blobs publishing\import (Consensys#8728)

* use correct schema definitions when creation full beacon block (Consensys#8806)

* use correct schema definitions when creation full beacon block

* Electra devnet 5 (Consensys#8817)

use forkChoiceUpdatedV4 with PayloadAttributesV4 

Co-authored-by: Mehdi AOUADI <[email protected]>
Co-authored-by: Enrico Del Fante <[email protected]>

* Update dependencies (Consensys#8818)

* add new Electra config parameters (Consensys#8819)

* Ephemery startup network determination (Consensys#8781)

fixes Consensys#8777

Signed-off-by: Paul Harris <[email protected]>

* update mischelpers with new parameters (Consensys#8821)

* run `Forkchoice::onBlock` async in block importer (Consensys#8820)

* 8767 update blobs gossip (Consensys#8822)

* update blob sidecars gossip topics

* use misc helpers to get blob sidecars subnet count

* remove unused method in gossip filter test

* 8767 update blobs rpc methods (Consensys#8823)

* update blobs rpc methods

* migrate capella schemas (Consensys#8825)

* Improve error on local EL blobs lookup (Consensys#8826)

* Migrate some deneb schemas to registry (Consensys#8828)

* Simplify schema provider definition (Consensys#8829)

* In `SpecVersion`, make `SpecConfig` instance consistent with milestone (Consensys#8830)

* Fix missed subscriptions

* 8767 update payload attributes (Consensys#8824)

Co-authored-by: Enrico Del Fante <[email protected]>

* More schema registry migration (Consensys#8832)

* Migrate beacon state (Consensys#8833)

* migrate beacon state

* fix historical summary schema

* fix ref test compilation

* fix ref tests

* schemaName provided to creator (Consensys#8834)

* update netty (Consensys#8838)

* Migrate builder bids to schema registry (Consensys#8836)

* Migrate block content schemas (Consensys#8843)

* migrate-block-content-schemas

* deleted too much

* lookup cache first

* migrate other electra schemas (Consensys#8845)

* Add Fulu

* Fix incorrect variable syntax Update fetch-blocks.sh (Consensys#8842)

Fix incorrect variable syntax in state download request

Co-authored-by: Paul Harris <[email protected]>

* Fix EIP7594 activation bugs and delegating SpecConfig

* tiny blobs pruner fix (Consensys#8854)

* Refactor BlockProcessor and EpochProcessor (Consensys#8856)

* Fix Fulu bugs

* Track produced block when builder doesn't reveal the payload (Consensys#8855)

* [Engine-API] Exclude empty requests in requests list (Consensys#8859)

* Fix wrong activation for EIP7594

* Performance tracker (Consensys#8851)

* use attestation bits aggregator in performance tracker

* add electra tests

* fix spotless

* fix unit test

* always clear objects

* refactor bits aggregator or operation

* revert bits aggregator or operation return type

* Reduce blobs lookup min wait time to 0 (Consensys#8864)

* alter ActiveP2pNetwork concept of close to in sync (Consensys#8853)

 - moved the isCloseToInSync into recentChaindata

Signed-off-by: Paul Harris <[email protected]>
Co-authored-by: Enrico Del Fante <[email protected]>

* Provide `SingleAttestation` datastructure (Consensys#8867)

* Enable publish blobs after block by default (Consensys#8868)

* Fix block publishing

* Logic to handle new validators during epoch processing (Consensys#8874)

* move MAX_BLOBS_PER_BLOCK from preset to config params (Consensys#8879)

* move MAX_BLOBS_PER_BLOCK from preset to config params

* Don't subscribe in AttestationTopicSubscriber if subscription is outdated (Consensys#8837)

* Don't subscribe in AttestationTopicSubscriber if subscription is outdated (Consensys#8837)

* Fix ExecutionRequestsDataCodec handling of missing request data (Consensys#8880)

* Added SingleAttestation to ref-test ssz executor (Consensys#8881)

* Added SingleAttestationEvent (Consensys#8873)

 - if the attestation arriving is a singleAttestation, will fire a single_attestation event, otherwise will trigger an attestation event.

- at the moment we only see attestations, but added unit test and can re-verify once we have single attestations being produced...

 - can essentially listen to both by :
 `curl -H "Accept:text/event-stream" -N http://localhost:5051/eth/v1/events\?topics\=attestation,single_attestation`

Signed-off-by: Paul Harris <[email protected]>

* Temp fix for EL

* Bump max subscribed topics limit, it's more than 150 on any PeerDAS 1 fork

* fix event types message (Consensys#8885)

Signed-off-by: Paul Harris <[email protected]>

* Implements SingleAttestation handling (Consensys#8884)

* Electra ref-test alpha.9 update (Consensys#8882)

Co-authored by @StefanBratanov 
Co-authored by @gfukushima

* Missing synchronized method (Consensys#8894)

* Fix `is_syncing` API reporting when head is synced optimistically (Consensys#8889)

* Dependency updates December (Consensys#8898)

* fix gossip subscriptions (Consensys#8896)

* update post attestation interface for electra (Consensys#8893)

* Fix `SingleAttestation` in `PerformanceTracker` bug (Consensys#8902)

* add missing electra attestation processing committee check (Consensys#8901)

* add missing electra attestation processing committee check

* update libp2p (Consensys#8906)

* update withdrawal request contract address (Consensys#8904)

Co-authored-by: Lucas Saldanha <[email protected]>

* Passing GOSSIP_MAX_SIZE to snappy uncompressor (Consensys#8899)

* Passing GOSSIP_MAX_SIZE to snappy uncompressor
* Using GOSSIP_MAX_SIZE from network spec on LibP2PGossipNetworkBuilder
---------

Co-authored-by: Enrico Del Fante <[email protected]>

* Deprecate TTFB, RESP_TIMEOUT, introduce MAX_CONCURRENT_REQUESTS (Consensys#8839)

* Revert "Reduce blobs lookup min wait time to 0 (Consensys#8864)" and "Deprecate TTFB, RESP_TIMEOUT, ... (Consensys#8839)" (Consensys#8911)

* clear changelog (Consensys#8913)

* Deprecate TTFB, RESP_TIMEOUT, introduce MAX_CONCURRENT_REQUESTS (Consensys#8912)

(cherry picked from commit d633566)

* Fix config provider to fix spec config api (Consensys#8919)

* Implemented expectedGasLimit from spec (Consensys#8909)

Made a more complete test suite on the FN to show boundaries.

Signed-off-by: Paul Harris <[email protected]>

* Increase max gossip compressed size (Consensys#8924)

fixes Consensys#8921

Signed-off-by: Paul Harris <[email protected]>

* tmp

* added test case for comparing mainnet config output (Consensys#8917)


---------

Signed-off-by: Paul Harris <[email protected]>
Co-authored-by: Enrico Del Fante <[email protected]>

* Simplify blob sidecar availability checker (Consensys#8840)

* few fixes

* Updated PendingPartialWithdrawal field (validator_index) (Consensys#8923)


---------

Co-authored-by: Enrico Del Fante <[email protected]>

* fix datacolumnSidecars were not published

* Remove engine_forkChoiceUpdateV4 (Consensys#8925)

* remove engine_forkChoiceUpdateV4

* Remove BlobSidecar traces after FULU

* Change consolidated balance calculation + small refactor (Consensys#8908)

* Updated consolidation rules for devnet5 (Consensys#8876)

 - updated fuzzUtil to use prettyJson to report diffs for the tests that broke...

 - currently the fuzz utils need some changes, will just raise a draft until we're ready...

fixes Consensys#8875

Signed-off-by: Paul Harris <[email protected]>

* Add blobs increase params (Consensys#8883)

* add blobs increase params

Co-authored-by: Lucas Saldanha <[email protected]>

* fix wrong processor

* fix sync check

* Use 16-bit random value in validator filter (Consensys#8916)


---------

Signed-off-by: Paul Harris <[email protected]>
Co-authored-by: Paul Harris <[email protected]>
Co-authored-by: Mehdi AOUADI <[email protected]>
Co-authored-by: Enrico Del Fante <[email protected]>

* Fix single attestation publication (Consensys#8929)

* 24-12-1-clear-changelog (Consensys#8932)

* fix (Consensys#8907)

* No delay when fetching blobs with known block and no attempt to recover blobs for unknown block (Consensys#8927)

* Remove unused classes/modules (Consensys#8959)

* Fix log4j config deprecated option (Consensys#8966)

* Reduce response chunk arrival timeout (Consensys#8962)

* reduce AI generated PRs (Consensys#8971)

* Make `engine_getBlobsV1` not fork specific (Consensys#8961)

* tiny cleanups on BlockBlobSidecarsTrackersPoolImpl (Consensys#8972)

* Throttle outgoing requests by both peer and protocol id (Consensys#8969)

* tiny cleanups on BlockBlobSidecarsTrackersPoolImpl (Consensys#8975)

* Hardcode Bellatrix Terminal Blocks for all known networks (Consensys#8943)

* Hardcode Bellatrix TTD blocks for all known networks

* reset should affect total difficult overrides

* Fix chiado transition epoch

* Remove warning for terminal block hash and epoch network defaults

* Update default block gas limit to 36 million (Consensys#8976)

* Remove tuweni junit (Consensys#8940)

* Fix assemble

* Move to Fulu reference tests

* Remove outdated pr

* Remove soft-fork code

* Fix Fulu Metadata + test

* spotless

* Fix TODO: Don't iterate over columns that were not requested

* Fix invalid datacolumn sidecards dumping

* Remove eip7594 in blob versions, fix links

* Remove eip7594 traces from code

* Use SchemaRegistry in Fulu + MetadataMessage in all milestones with registry builder

* Fix MiscHelpersFuluTest

* Fix tests for Fulu

---------

Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Paul Harris <[email protected]>
Signed-off-by: gconnect <[email protected]>
Co-authored-by: Gabriel Fukushima <[email protected]>
Co-authored-by: Paul Harris <[email protected]>
Co-authored-by: Glory Agatevure <[email protected]>
Co-authored-by: Enrico Del Fante <[email protected]>
Co-authored-by: David Ryan <[email protected]>
Co-authored-by: Lucas Saldanha <[email protected]>
Co-authored-by: Stefan Bratanov <[email protected]>
Co-authored-by: Wolmin <[email protected]>
Co-authored-by: Anton Nashatyrev <[email protected]>
Co-authored-by: Mehdi AOUADI <[email protected]>
Co-authored-by: Justin Traglia <[email protected]>
Co-authored-by: Malay Dewangan <[email protected]>
Co-authored-by: wizard <[email protected]>
Co-authored-by: Enrico Del Fante <[email protected]>
  • Loading branch information
15 people authored Jan 17, 2025
1 parent 2260ffc commit 7c8e6c9
Show file tree
Hide file tree
Showing 2,773 changed files with 107,251 additions and 46,243 deletions.
37 changes: 33 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ executors:
architecture: "amd64"
platform: "linux/amd64"

machine_large_executor_amd64:
machine:
image: ubuntu-2204:2024.01.1 # https://circleci.com/developer/machine/image/ubuntu-2204
docker_layer_caching: true
resource_class: large
working_directory: ~/project
environment:
architecture: "amd64"
platform: "linux/amd64"

machine_executor_arm64:
machine:
image: ubuntu-2204:2024.01.1 # https://circleci.com/developer/machine/image/ubuntu-2204
Expand Down Expand Up @@ -237,13 +247,23 @@ jobs:
path: build/test-results

spotless:
executor: small_executor
executor: medium_executor
steps:
- prepare
- run:
name: Spotless
command: |
./gradlew --no-daemon --parallel checkMavenCoordinateCollisions spotlessCheck checkModuleDependencies
./gradlew --no-daemon --parallel spotlessCheck
- notify

moduleChecks:
executor: small_executor
steps:
- prepare
- run:
name: Module Checks
command: |
./gradlew --no-daemon --parallel checkMavenCoordinateCollisions checkModuleDependencies
- notify

dockerScan:
Expand Down Expand Up @@ -343,8 +363,8 @@ jobs:
path: build/test-results

acceptanceTests:
parallelism: 5
executor: machine_executor_amd64
parallelism: 4
executor: machine_large_executor_amd64
steps:
- install_java_21
- prepare
Expand Down Expand Up @@ -562,12 +582,17 @@ workflows:
filters:
tags: &filters-release-tags
only: /^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?/
- moduleChecks:
filters:
tags:
<<: *filters-release-tags
- spotless:
filters:
tags:
<<: *filters-release-tags
- windowsBuild:
requires:
- moduleChecks
- spotless
filters:
tags:
Expand Down Expand Up @@ -630,6 +655,7 @@ workflows:
- acceptanceTests
- referenceTests
- extractAPISpec
- moduleChecks
- spotless
- windowsBuild
context:
Expand All @@ -649,6 +675,7 @@ workflows:
- acceptanceTests
- referenceTests
- extractAPISpec
- moduleChecks
- spotless
- windowsBuild
context:
Expand All @@ -668,6 +695,7 @@ workflows:
- acceptanceTests
- referenceTests
- extractAPISpec
- moduleChecks
- spotless
- windowsBuild
context:
Expand Down Expand Up @@ -700,6 +728,7 @@ workflows:
- acceptanceTests
- referenceTests
- extractAPISpec
- moduleChecks
- spotless
- windowsBuild
nightly:
Expand Down
2 changes: 1 addition & 1 deletion .codespell/.codespellrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[codespell]
skip = .git,package-lock.json,LOG.old.*
skip = .git,package-lock.json,LOG.old.*,venv
count =
quiet-level = 3
ignore-words = ./.codespell/wordlist.txt
11 changes: 8 additions & 3 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ jobs:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Install prerequisites
run: pip install codespell
- name: Set up a Python venv and install prerequisites
run: |
python3 -m venv venv
source venv/bin/activate
pip install codespell
- name: Spell check
run: codespell --config=./.codespell/.codespellrc
run: |
source venv/bin/activate
codespell --config=./.codespell/.codespellrc
14 changes: 6 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@

## Current Releases

For information on changes in released versions of Teku, see
the [releases page](https://github.com/Consensys/teku/releases).

## Unreleased Changes

### Breaking Changes
`--Xvalidators-builder-registration-default-gas-limit` is removed in favour of `--validators-builder-registration-default-gas-limit`

### Additions and Improvements
- Increased the executor queue default maximum size to 40_000 (previously 20_000), and other queues to 10_000 (previously 5_000). If you have custom settings for these queues, check to ensure they're still required.
- Added `peers_direction_current` libp2p metric to track the number of peers by direction (inbound and outbound).
- Deposit tree snapshots will be loaded from database as a default unless custom snapshot has been provided.
- Added hidden option `--Xdeposit-contract-logs-syncing-enabled` to allow disabling the syncing of the deposit contract logs from the EL. This is useful when running a non-validating node. It is advisable to be used alongside with `--Xeth1-missing-deposits-event-logging-enabled=false` to avoid unnecessary logging of missing deposits.
- Updated the bootnodes for Chiado and Gnosis networks
- Default the gas limit to 36 million for externally produced blocks
- Optimized blobs validation pipeline
- Remove delay when fetching blobs from the local EL on block arrival

### Bug Fixes
- Fix `--version` command output [#8960](https://github.com/Consensys/teku/issues/8960)
- Fix issue (introduced in `24.12.1`) with peer stability when the upperbound is set to a high number
5 changes: 4 additions & 1 deletion acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dependencies {
testImplementation 'io.tmio:tuweni-units'

acceptanceTestImplementation project(":infrastructure:bls")
acceptanceTestImplementation project(':infrastructure:time')
acceptanceTestImplementation project(':data:serializer')
Expand All @@ -19,6 +21,7 @@ dependencies {
testFixturesImplementation project(':infrastructure:metrics')
testFixturesImplementation testFixtures(project(':infrastructure:async'))
testFixturesImplementation project(':teku')
testFixturesImplementation project(':ethereum:json-types')

testFixturesImplementation project(':infrastructure:crypto')
testFixturesImplementation project(':infrastructure:time')
Expand All @@ -27,7 +30,7 @@ dependencies {
testFixturesImplementation 'io.libp2p:jvm-libp2p'
testFixturesImplementation 'org.apache.commons:commons-lang3'
testFixturesImplementation 'commons-io:commons-io'
testFixturesImplementation 'org.apache.tuweni:tuweni-bytes'
testFixturesImplementation 'io.tmio:tuweni-bytes'
testFixturesImplementation 'org.junit.jupiter:junit-jupiter-api'
testFixturesImplementation 'org.testcontainers:testcontainers'
testFixturesImplementation 'org.testcontainers:junit-jupiter'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
import java.util.Arrays;
import java.util.Locale;
import org.apache.tuweni.bytes.Bytes32;
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.api.schema.eip7594.SignedBeaconBlockEip7594;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import tech.pegasys.teku.infrastructure.bytes.Bytes20;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.teku.test.acceptance.dsl.GenesisGenerator.InitialStateData;
Expand All @@ -34,8 +35,9 @@
public class BlockProposalAcceptanceTest extends AcceptanceTestBase {
private static final URL JWT_FILE = Resources.getResource("auth/ee-jwt-secret.hex");

@Test
void shouldHaveCorrectFeeRecipientAndGraffiti() throws Exception {
@ParameterizedTest(name = "ssz_encode={0}")
@ValueSource(booleans = {true, false})
void shouldHaveCorrectFeeRecipientAndGraffiti(final boolean useSszBlocks) throws Exception {
final String networkName = "swift";

final ValidatorKeystores validatorKeystores =
Expand All @@ -45,10 +47,7 @@ void shouldHaveCorrectFeeRecipientAndGraffiti() throws Exception {
createGenesisGenerator()
.network(networkName)
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ONE)
.withCapellaEpoch(UInt64.valueOf(2))
.withDenebEpoch(UInt64.valueOf(3))
.withEip7594Epoch(UInt64.valueOf(4))
.withBellatrixEpoch(UInt64.ZERO)
.validatorKeys(validatorKeystores, validatorKeystores)
.generate();

Expand All @@ -61,14 +60,8 @@ void shouldHaveCorrectFeeRecipientAndGraffiti() throws Exception {
.withJwtSecretFile(JWT_FILE)
.withNetwork(networkName)
.withInitialState(genesis)
.withRealNetwork()
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ONE)
.withCapellaEpoch(UInt64.valueOf(2))
.withDenebEpoch(UInt64.valueOf(3))
.withEip7594Epoch(UInt64.valueOf(4))
.withTotalTerminalDifficulty(0)
.withTrustedSetupFromClasspath("mainnet-trusted-setup.txt")
.withBellatrixEpoch(UInt64.ZERO)
.withValidatorProposerDefaultFeeRecipient(defaultFeeRecipient)
.build());
final TekuValidatorNode validatorClient =
Expand All @@ -78,22 +71,26 @@ void shouldHaveCorrectFeeRecipientAndGraffiti() throws Exception {
.withValidatorProposerDefaultFeeRecipient(defaultFeeRecipient)
.withInteropModeDisabled()
.withBeaconNodes(beaconNode)
.withBeaconNodeSszBlocksEnabled(useSszBlocks)
.withGraffiti(userGraffiti)
.withNetwork("auto")
.build());

beaconNode.start();
validatorClient.start();

beaconNode.waitForEpochAtOrAbove(4);
beaconNode.waitForBlockSatisfying(
block -> {
assertThat(block).isInstanceOf(SignedBeaconBlockEip7594.class);
final SignedBeaconBlockEip7594 eip7594Block = (SignedBeaconBlockEip7594) block;
assertThat(
eip7594Block.getMessage().getBody().executionPayload.feeRecipient.toHexString())
final Bytes20 feeRecipient =
block
.getMessage()
.getBody()
.getOptionalExecutionPayload()
.orElseThrow()
.getFeeRecipient();
assertThat(feeRecipient.toHexString().toLowerCase(Locale.ROOT))
.isEqualTo(defaultFeeRecipient.toLowerCase(Locale.ROOT));
final Bytes32 graffiti = eip7594Block.getMessage().getBody().graffiti;
final Bytes32 graffiti = block.getMessage().getBody().getGraffiti();
final String graffitiMessage =
new String(
Arrays.copyOfRange(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
* Copyright Consensys Software Inc., 2022
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

package tech.pegasys.teku.test.acceptance;

import com.google.common.io.Resources;
import java.net.URL;
import java.util.Map;
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.ethereum.execution.types.Eth1Address;
import tech.pegasys.teku.infrastructure.time.SystemTimeProvider;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.teku.test.acceptance.dsl.BesuDockerVersion;
import tech.pegasys.teku.test.acceptance.dsl.BesuNode;
import tech.pegasys.teku.test.acceptance.dsl.GenesisGenerator.InitialStateData;
import tech.pegasys.teku.test.acceptance.dsl.TekuBeaconNode;
import tech.pegasys.teku.test.acceptance.dsl.TekuNodeConfig;
import tech.pegasys.teku.test.acceptance.dsl.TekuNodeConfigBuilder;
import tech.pegasys.teku.test.acceptance.dsl.Web3SignerNode;
import tech.pegasys.teku.test.acceptance.dsl.tools.ValidatorKeysApi;
import tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores;

public class CapellaRemoteSignerAcceptanceTest extends AcceptanceTestBase {

private static final String NETWORK_NAME = "swift";
public static final Eth1Address WITHDRAWAL_ADDRESS =
Eth1Address.fromHexString("0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
private static final URL JWT_FILE = Resources.getResource("auth/ee-jwt-secret.hex");

@Test
void capellaWithRemoteSigner() throws Exception {
final UInt64 currentTime = new SystemTimeProvider().getTimeInSeconds();
final int genesisTime =
currentTime.intValue() + 30; // genesis needs added time for nodes to startup

final Web3SignerNode web3SignerNode =
createWeb3SignerNode(
config ->
config
.withNetwork(NETWORK_NAME)
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withCapellaEpoch(UInt64.ZERO));

web3SignerNode.start();
final ValidatorKeysApi signerApi = web3SignerNode.getValidatorKeysApi();
final BesuNode besuNode = createBesuNode(genesisTime);
besuNode.start();

final ValidatorKeystores validatorKeys =
createTekuDepositSender(NETWORK_NAME).generateValidatorKeys(4, WITHDRAWAL_ADDRESS);

signerApi.addLocalValidatorsAndExpect(validatorKeys, "imported");
signerApi.assertLocalValidatorListing(validatorKeys.getPublicKeys());

final InitialStateData initialStateData =
createGenesisGenerator()
.network(NETWORK_NAME)
.withGenesisTime(genesisTime)
.genesisDelaySeconds(0)
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withCapellaEpoch(UInt64.ZERO)
.withTotalTerminalDifficulty(0)
.genesisExecutionPayloadHeaderSource(besuNode::createGenesisExecutionPayload)
.validatorKeys(validatorKeys)
.generate();

final TekuBeaconNode tekuNode =
createTekuBeaconNode(
beaconNode(
genesisTime, besuNode, initialStateData, web3SignerNode.getValidatorRestApiUrl()));

tekuNode.start();

tekuNode.waitForNextEpoch();
tekuNode.waitForNewBlock();
tekuNode.waitForFullSyncCommitteeAggregate();
}

private BesuNode createBesuNode(final int genesisTime) {
final int shanghai =
genesisTime + 2; // 4 slots, 2 seconds each (swift) - activate Prague on first slot
final Map<String, String> genesisOverrides = Map.of("shanghaiTime", String.valueOf(shanghai));

return createBesuNode(
BesuDockerVersion.STABLE,
config ->
config
.withMergeSupport()
.withGenesisFile("besu/mergedGenesis.json")
.withP2pEnabled(true)
.withJwtTokenAuthorization(JWT_FILE),
genesisOverrides);
}

private static TekuNodeConfig beaconNode(
final int genesisTime,
final BesuNode besuNode,
final InitialStateData initialStateData,
final String signerUrl)
throws Exception {
return TekuNodeConfigBuilder.createBeaconNode()
.withInitialState(initialStateData)
.withInteropModeDisabled()
.withNetwork(NETWORK_NAME)
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withCapellaEpoch(UInt64.ZERO)
.withTotalTerminalDifficulty(0)
.withGenesisTime(genesisTime)
.withExecutionEngine(besuNode)
.withJwtSecretFile(JWT_FILE)
.withExternalSignerUrl(signerUrl)
.withExternalSignerPublicKeys("external-signer")
.withValidatorProposerDefaultFeeRecipient("0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73")
.withStartupTargetPeerCount(0)
.withRealNetwork()
.build();
}
}
Loading

0 comments on commit 7c8e6c9

Please sign in to comment.