eth/consensus : implement eccpow consensus engine#10
Open
mmingyeomm wants to merge 3590 commits into
Open
Conversation
Next() function in RawIterator returned true on decompression errors.Now it returns false on those cases. Redundant error check on cmd/era/main.go is also removed. --------- Co-authored-by: Bosul Mun <bsbs8645@snu.ac.kr>
This PR addresses one of the biggest performance issue with binary tries: storing each internal node individually bloats the index, the disk, and triggers a lot of write amplifications. To fix this issue, this PR serializes groups of nodes together. Because we are still looking for the ideal group size, the "depth" of the group tree is made a parameter, but that will be removed in the future, once the perfect size is known. This is a rebase of #33658 --------- Co-authored-by: Copilot <copilot@github.com>
The mux tracer fanned out every standard hook to its children but never
forwarded OnSystemCall{Start,End}. Tracers that rely on these - like
`logger.jsonLogger`, which uses the start hook to silence its opcode
hook for the duration of a system call - never got the signal when
wrapped behind a mux.
In evm t8n, combining `--trace` with `--opcode-count` (default for geth
with exec specs) produces exactly that wrapping. The first system call
(e.g. `ProcessBeaconBlockRoot`) then fires `OnOpcode` on the json logger
before any `OnTxStart` has run, dereferencing a nil env and crashing
t8n.
Forward both hooks through the mux. The V2 fan-out falls back to V1 for
children that only implement the legacy hook, mirroring the precedence
already used in `core/state_processor.go`.
This updates the typed `ethclient` model for `eth_simulateV1` call results to include `maxUsedGas`, matching the field already returned by the server-side RPC response. Follow-up to #32789.
Fixes a condition in a snapshot-related test.
Disables the recently added log indexer from a simulated backend. In most cases the log indexer is not required and unindexed search should be fast enough. Fixes #32552.
Apply block overrides to header in eth_call so EIP-1559 fee fields use the correct overridden basefee.
the gapped queue cap was effectively per-sender rather than total — a sender pool spread across enough distinct addresses could grow `p.gapped` well past `maxGapped`, defeating the resource bound. `maxGapped` was being compared against `len(p.gapped)`, which is a `map[address][]tx` and counts unique senders, not queued txs. Switched the check to `len(p.gappedSource)` (keyed by tx hash, so its length is the real total). Also wired up a `blobpool/gapped/count` gauge plus `promoted`, `evicted`, and `gappedfull` meters so queue size and churn are actually observable in prod.
Fixes the muxTracer to correctly forward events to v2 state hooks, i.e. `OnCodeChangeV2` and `OnNonceChangeV2`.
Re-exports errors in bind package. --------- Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
The reconstruct callback indexes parallel response slices (bodies, receipts). Passing the accept counter used the wrong element when an earlier header in the same batch hit a stale slot.
…34878) The refactor from `for el := plist.Front(); ...; el = el.Next()` to the new `iterList` iterator in #34743 silently dropped two things needed by resetTimeout: 1. `nextTimeout = el.Value.(*replyMatcher)` at the top of the loop. This assignment is what gives `nextTimeout` its documented meaning ("head of plist when timeout was last reset"), and what makes the early-return optimization at the top of resetTimeout work. Without it, nextTimeout is only ever written to nil, so `nextTimeout == plist.Front().Value` is always false and the optimization is dead. 2. `nextTimeout.errc <- errClockWarp` in the clock-warp branch now reads a stale or nil pointer. Prior to the refactor, the inner assignment kept nextTimeout pointing at the current matcher so its errc was the right channel to receive the errClockWarp signal. After the refactor, on first entry into the clock-warp branch nextTimeout is nil, which panics the UDPv4 loop goroutine with a nil pointer deref and takes discv4 down. Re-assign `nextTimeout = p` at the head of the loop (restoring the documented invariant) and send the clock-warp error on `p.errc` rather than the now-stale `nextTimeout.errc`. The clock-warp branch triggers only when the system clock jumps backward after a deadline is assigned (deadline - time.Now() >= 2*respTimeout, i.e. at least ~500ms backward jump), which is why this regression slipped past CI - it is not exercised by any existing unit test, and writing one would require plumbing a clock through the loop.
## Summary Fixes #31917. `geth era-download` now only prints `is stale` when an existing downloaded file fails checksum verification. Missing files are still downloaded normally, but no longer get mislabeled as stale. ## Why `DownloadFile` used `verifyHash` for both missing files and checksum mismatches, then printed `is stale` for any error. This made first-time downloads look like corrupt or outdated files. ## Validation - `make all` - `go run ./build/ci.go test` - `go run ./build/ci.go lint` - `go run ./build/ci.go check_generate` - `go run ./build/ci.go check_baddeps` --------- Co-authored-by: Felix Lange <fjl@twurst.com>
Implements https://github.com/ethereum/execution-apis/pull/786/changes as discussed on standup today --------- Co-authored-by: Gary Rong <garyrong0905@gmail.com>
When `io.Copy` succeeds but the buffered `Close` fails (e.g. disk full on `Flush`), the error was swallowed and verification reported a misleading hash mismatch instead of the real I/O failure. Keep the `Close` error when `io.Copy` didn't already produce one. --------- Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
This PR adds `AdoptSyncedState()` alongside `Enable()`. It does the same pathdb bookkeeping (now factored into a shared `resetForReactivation()` helper), but skips the regeneration. The wiring/calling code lands in #34626 --------- Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This is an alternative PR for #34746. This PR implements the second approach among the two possible solutions mentioned in the above PR. Requests for unavailable items are possible when the peer is following a different fork from us. However this is not expected to happen frequently. Considering the amount of complexity added to the codebase, the simpler approach (this PR) can be preferred.
#32924) This PR makes a small update to the `Pending()` method in the legacy pool. By changing the lock from exclusive to read-only, it aims to improve concurrency performance. --------- Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Fixes the exclusion list of the accessListTracer. --------- Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
…4888) This fixes an issue where packets send to the `Unhandled` channel configured on discv4 could be corrupted when the packet buffer gets reused. --------- Co-authored-by: Felix Lange <fjl@twurst.com>
replace the not used event.Typemux to event.Feed --------- Co-authored-by: Felix Lange <fjl@twurst.com>
) Fixes #34881 This fixes a hang in `Table.waitForNodes`. It is a replacement for PRs #34890, #33665 which tried to fix the same issue in a different way. - #34890 doesn't really fix the issue, just makes it less likely - #33665 tries to fix it by moving the feed send outside of the lock I created this PR because I want to keep the synchronous node feed sending in `Table.nodeAdded`. --------- Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
) `GetBlobs` returned early when `CellProofsAt` reported corrupted/out-of-bounds proofs, dropping every blob already collected and aborting the remaining hashes — a single bad sidecar killed the whole Engine API batch for consensus clients. Replaced the `return nil, nil, nil, err` with `log.Error + continue` so the slot stays `nil` per the sparse-array contract, matching the store/RLP/nil-sidecar branches a few lines above.
Passing `--graphql=false` currently still registers the GraphQL handler because the startup path checks whether the flag was set, not its boolean value. This switches the registration condition to use `ctx.Bool`, so explicit false disables GraphQL while the default behavior remains unchanged.
This PR applies the 7997 irregular state transition in t8n, block building, simulation and tracing.
) Closes #35314. ### Problem `TransactionArgs.ToTransaction` selects `SetCodeTxType` when an `authorizationList` is present, but then unconditionally downgrades to `LegacyTxType` when `gasPrice` is set: ```go case args.AuthorizationList != nil || defaultType == types.SetCodeTxType: usedType = types.SetCodeTxType ... if args.GasPrice != nil { usedType = types.LegacyTxType } ``` A legacy transaction cannot carry an EIP-7702 authorization list, so the list is silently dropped. `eth_sendTransaction`, `eth_signTransaction` and `eth_fillTransaction` can then return a plain legacy transaction/hash even though the requested delegation update or revocation was never included. The downgrade also masks a latent issue: `setFeeDefaults` returns early once `gasPrice` is set (without `authorizationList`) and never fills `MaxFeePerGas`/`MaxPriorityFeePerGas`. Building the `SetCodeTx` without the downgrade would hit `uint256.MustFromBig((*big.Int)(args.MaxFeePerGas))` with a nil fee cap and panic. Erroring early is therefore the correct behavior. ### Fix Reject the `gasPrice` + `authorizationList` combination in `setFeeDefaults`, mirroring the existing `gasPrice` / EIP-1559 guard, so the request fails explicitly instead of producing a transaction that omits the authorization list. ### Test Added a `setFeeDefaults` case asserting the new error. Verified fail-on-main: with the guard reverted the test fails (`expected error: both gasPrice and authorizationList specified`); with the guard it passes. Full `internal/ethapi` package, `go vet` and `gofmt` are clean. ### Note The same silent-drop applies to `gasPrice` + `blobVersionedHashes` (blob transactions also cannot be legacy). I scoped this PR to the reported `authorizationList` case; happy to extend the guard to blob hashes in the same spot if preferred.
This PR does a few things: - reject `debug_setHead` if the target is even before the pivot block (if non-nil) - reject `debug_setHead` if in path mode, the target is not recoverable - decouple the chain rewinding and state recovery in path mode and recover the state in one shot --------- Co-authored-by: jonny rhea <5555162+jrhea@users.noreply.github.com>
## Summary Sanity fixes surfaced by running the EELS `tests@v20.0.0` fixture release (63,109 blockchain tests) through `evm blocktest`. Also bumps CI to consume the new release: `build/checksums.txt` now points at `tests@v20.0.0` / `fixtures.tar.gz` from `ethereum/execution-specs` (supersedes the archived EEST repo's `fixtures_develop`). --------- Co-authored-by: Gary Rong <garyrong0905@gmail.com>
…ion stats (#34702) The peer dropper periodically disconnects random peers to create churn. This was previously blind to peer quality. This PR adds peer-score based peer protection, handling the multi-dimensionality problem of peer scoring through the concept of protected peer pools. --------- Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com> Co-authored-by: healthykim <bsbs8645@snu.ac.kr>
Updates ckzg to the newest version
Implement EIP spec change https://github.com/ethereum/EIPs/pull/11908/changes --------- Co-authored-by: Gary Rong <garyrong0905@gmail.com>
WithAttrs and terminalFormat appended to h.attrs directly, which can mutate the shared slice when it has spare capacity. Clone attrs first to avoid corrupting parent handler state.
## Summary - Only apply user-configured `MaxBlobsPerBlock` when it is strictly below the protocol-defined maximum. - Prevents the miner from building blocks that exceed the consensus blob limit. ## Test plan - [x] `go test -short ./miner/`
Necessary for building fuzzers that don't take 10s of seconds for tracing a test
Correctly passes BAL around in engine api --------- Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Implement the spec changes of EIP-2780 and EIP-8037. See the spec diffs in - ethereum/EIPs#11844 - ethereum/EIPs#11891 - ethereum/EIPs#11906 - ethereum/EIPs@a4801f3 --------- Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Adds stubs for Bogota fork.
…encies (#32164) When we are deploying library dependencies, if the `TransactOpts` nonce is unset we will choose the nonce of the next deployment transaction based on the pending nonce of the sender. If a previous library deployment transaction was made but not yet accepted into the pool, the pending nonce will not be updated for the the next deployment transaction. This PR introduces a new method to the bind API `WaitAccepted` which poll until a submitted transaction hash is accepted into the pool or rejected. The bindings for v1 are updated to invoke this method after deploying each library dependency.
…S trees (#35312) The DNS discovery crawler (ethereum/discv4-crawl) builds signed enrtree lists by crawling the network and running the collected records through `devp2p nodeset filter` and `devp2p dns sign`. Those records come from external nodes, and `enr.Record` keeps entries it can't decode as raw RLP, so a self-signed record with an out-of-range port (EIP-778 defines ports only as "big endian integer", not `uint16`) can round-trip verbatim into a signed tree. Consumers that decode ports strictly then fail to decode that record. Two publish-side checks: - `MakeTree` rejects a record if a present port entry (`tcp`/`tcp6`/`udp`/`udp6`/`quic`/`quic6`) does not decode as a `uint16`. This is an invariant at the signing boundary: geth won't sign a tree containing a record with an undecodable port, regardless of how the node list was produced. Absent and zero ports are unaffected. - `devp2p nodeset filter -dialable` keeps only nodes advertising a usable RLPx port (non-zero `tcp`/`tcp6`/`quic`/`quic6`), letting the crawler drop discovery-only and unreachable nodes so consumers aren't handed peers they can't connect to. The two are deliberately separate: the `MakeTree` check is a correctness guard that always applies, while `-dialable` is an opt-in selection filter for the crawler pipeline. A follow-up will add `-dialable` to discv4-crawl's `filter_list`.
- Move `msg.Discard` defer ahead of the max message size check in `handleMessage`. - Ensures oversized messages are released when the handler returns early.
#34057 added the Bogota fork, but didn't add it to payloadVersion. This PR fixes the CI error.
--------- Co-authored-by: jonny rhea <5555162+jrhea@users.noreply.github.com>
This is the implementation of EIP-8070 Sparse Blobpool. It introduces protocol version eth/72 which relays blob transaction cells instead of full blobs. The blobpool now store 'incomplete' transactions, where only some of the cells are provided. The stored cell indexes are taken from the custody bitmap, which is provided by the consensus layer in forkchoiceUpdatedV4. This method will be called once Glamsterdam activates, and the default custody is full custody, so for now there is no change in the amount of stored cells for now. The main entities added are the BlobBuffer and BlobFetcher, which work together to track and fetch missing cells from connected peers. The partial transactions become available for inclusion in blocks when they are covered by enough peers that hold all cells. This change also introduces engine_getBlobsV4, which allows for cell-based responses (and partial blobs with only some of the cells). We maintain backward compatibility with getBlobsV3 which expects full blob responses by recovering the blob from available cells. Since this process is resource-intensive, we proactively cache the conversion so it is ready in time for getBlobsV3 calls. This mechanism will be removed once support for getBlobsV4 is universal across all consensus layer implementations. devp2p tests for eth/72 are not part of this initial change. This is to avoid breaking test success status for execution clients that do not have eth/72 implemented yet. The tests will be added in a subsequent change. --------- Co-authored-by: Felix Lange <fjl@twurst.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
implements eccpow consensus engine for Worldland Network