-
Notifications
You must be signed in to change notification settings - Fork 954
Merge go-ethereum v1.16.5 #726
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
base: optimism
Are you sure you want to change the base?
Conversation
Fix outdated comments
Bail out of decodeHash when the raw hex string is longer than 32 byte before actually decoding. --------- Co-authored-by: lightclient <[email protected]>
Decode the modified transaction and verify the value differs from original. --------- Co-authored-by: lightclient <[email protected]>
Fix incorrect error messages in TestVerkleTreeReadWrite and TestVerkleRollBack functions.
Introduces a new tracer which returns the preimages of evm KECCAK256 hashes. See #32570. --------- Co-authored-by: Sina M <[email protected]> Co-authored-by: Sina Mahmoodi <[email protected]>
Adds Amsterdam as fork config option. Co-authored-by: lightclient <[email protected]>
ref https://github.com/ethereum/execution-apis/blob/main/src/engine/osaka.md#cancun-api > Client software MUST return -38005: Unsupported fork error if the Osaka fork has been activated. --------- Signed-off-by: Delweng <[email protected]> Co-authored-by: rjl493456442 <[email protected]>
Fixes an error message in TestReplication
Removes a redundant check in TestCreateAccessListWithStateOverrides
These functions were previously ignoring the error returned by both `statedb.Commit()` and the subsequent `state.New()`, which could silently fail and cause panics later when the `statedb` is used. This change adds proper error checking and panics with a descriptive error message if state creation fails. While unlikely in normal operation, this can occur if there are database corruption issues or if invalid root hashes are provided, making debugging significantly easier when such issues do occur. This issue was encountered and fixed in gballet/go-ethereum#552 where the error handling proved essential for debugging cc: @gballet as this was discussed in a call already.
Looks like we forgot to update names when copying.
- Replace outdated NewFreezer doc that referenced map[string]bool/snappy toggle with accurate description of -map[string]freezerTableConfig (noSnappy, prunable). - Fix misleading field comment on freezerTable.config that spoke as if it were a boolean (“if true”), clarifying it’s a struct and noting compression is non-retroactive.
Fixes issue #32762 where ChainConfig logging displays pointer addresses instead of actual timestamp values for fork activation times. Before: ShanghaiTime:(*uint64)(0xc000373fb0), CancunTime:(*uint64)(0xc000373fb8) After: ShanghaiTime: 1681338455, CancunTime: 1710338135, VerkleTime: nil The String() method properly dereferences timestamp pointers and handles nil values for unset fork times, making logs more readable and useful for debugging chain configuration issues. --------- Co-authored-by: rjl493456442 <[email protected]>
Extend the chain banner with blob config information. Co-authored-by: Felix Lange <[email protected]>
The TxPool.signer field was never read and each subpool (legacy/blob) maintains its own signer instance. This field remained after txpool refactoring into subpools and is dead code. Removing it reduces confusion and simplifies the constructor.
This is required for geth to compile to WASM.
… (#32800) This PR updates the `payloadVersion` function in `simulated_beacon.go` to handle additional following forks used during development and testing phases after Osaka. This change ensures that the simulated beacon correctly resolves the payload version for these forks, enabling consistent and valid execution payload handling during local testing or simulation.
Alternative to #30746, potential follow-up to #30743 . This PR makes the
stacktrie always copy incoming value buffers, and reuse them internally.
Improvement in #30743:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ derivesha.1 │ derivesha.2 │
│ sec/op │ sec/op vs base │
DeriveSha200/stack_trie-8 477.8µ ± 2% 430.0µ ± 12% -10.00% (p=0.000 n=10)
│ derivesha.1 │ derivesha.2 │
│ B/op │ B/op vs base │
DeriveSha200/stack_trie-8 45.17Ki ± 0% 25.65Ki ± 0% -43.21% (p=0.000 n=10)
│ derivesha.1 │ derivesha.2 │
│ allocs/op │ allocs/op vs base │
DeriveSha200/stack_trie-8 1259.0 ± 0% 232.0 ± 0% -81.57% (p=0.000 n=10)
```
This PR further enhances that:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ derivesha.2 │ derivesha.3 │
│ sec/op │ sec/op vs base │
DeriveSha200/stack_trie-8 430.0µ ± 12% 423.6µ ± 13% ~ (p=0.739 n=10)
│ derivesha.2 │ derivesha.3 │
│ B/op │ B/op vs base │
DeriveSha200/stack_trie-8 25.654Ki ± 0% 4.960Ki ± 0% -80.67% (p=0.000 n=10)
│ derivesha.2 │ derivesha.3 │
│ allocs/op │ allocs/op vs base │
DeriveSha200/stack_trie-8 232.00 ± 0% 37.00 ± 0% -84.05% (p=0.000 n=10)
```
So the total derivesha-improvement over *both PRS* is:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ derivesha.1 │ derivesha.3 │
│ sec/op │ sec/op vs base │
DeriveSha200/stack_trie-8 477.8µ ± 2% 423.6µ ± 13% -11.33% (p=0.015 n=10)
│ derivesha.1 │ derivesha.3 │
│ B/op │ B/op vs base │
DeriveSha200/stack_trie-8 45.171Ki ± 0% 4.960Ki ± 0% -89.02% (p=0.000 n=10)
│ derivesha.1 │ derivesha.3 │
│ allocs/op │ allocs/op vs base │
DeriveSha200/stack_trie-8 1259.00 ± 0% 37.00 ± 0% -97.06% (p=0.000 n=10)
```
Since this PR always copies the incoming value, it adds a little bit of
a penalty on the previous insert-benchmark, which copied nothing (always
passed the same empty slice as input) :
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/trie
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ stacktrie.7 │ stacktrie.10 │
│ sec/op │ sec/op vs base │
Insert100K-8 88.21m ± 34% 92.37m ± 31% ~ (p=0.280 n=10)
│ stacktrie.7 │ stacktrie.10 │
│ B/op │ B/op vs base │
Insert100K-8 3.424Ki ± 3% 4.581Ki ± 3% +33.80% (p=0.000 n=10)
│ stacktrie.7 │ stacktrie.10 │
│ allocs/op │ allocs/op vs base │
Insert100K-8 22.00 ± 5% 26.00 ± 4% +18.18% (p=0.000 n=10)
```
---------
Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Felix Lange <[email protected]>
Description: We found a occasionally node hang issue on BSC, I think Geth may also have the issue, so pick the fix patch here. The fix on BSC repo: bnb-chain/bsc#3347 When the hang occurs, there are two routines stuck. - routine 1: AsyncFilter(...) On node start, it will run part of the DiscoveryV4 protocol, which could take considerable time, here is its hang callstack: ``` goroutine 9711 [chan receive]: // this routine was stuck on read channel: `<-f.slots` github.com/ethereum/go-ethereum/p2p/enode.AsyncFilter.func1() github.com/ethereum/go-ethereum/p2p/enode/iter.go:206 +0x125 created by github.com/ethereum/go-ethereum/p2p/enode.AsyncFilter in goroutine 1 github.com/ethereum/go-ethereum/p2p/enode/iter.go:192 +0x205 ``` - Routine 2: Node Stop It is the main routine to shutdown the process, but it got stuck when it tries to shutdown the discovery components, as it tries to drain the channel of `<-f.slots`, but the extra 1 slot will never have chance to be resumed. ``` goroutine 11796 [chan receive]: github.com/ethereum/go-ethereum/p2p/enode.(*asyncFilterIter).Close.func1() github.com/ethereum/go-ethereum/p2p/enode/iter.go:248 +0x5c sync.(*Once).doSlow(0xc032a97cb8?, 0xc032a97d18?) sync/once.go:78 +0xab sync.(*Once).Do(...) sync/once.go:69 github.com/ethereum/go-ethereum/p2p/enode.(*asyncFilterIter).Close(0xc092ff8d00?) github.com/ethereum/go-ethereum/p2p/enode/iter.go:244 +0x36 github.com/ethereum/go-ethereum/p2p/enode.(*bufferIter).Close.func1() github.com/ethereum/go-ethereum/p2p/enode/iter.go:299 +0x24 sync.(*Once).doSlow(0x11a175f?, 0x2bfe63e?) sync/once.go:78 +0xab sync.(*Once).Do(...) sync/once.go:69 github.com/ethereum/go-ethereum/p2p/enode.(*bufferIter).Close(0x30?) github.com/ethereum/go-ethereum/p2p/enode/iter.go:298 +0x36 github.com/ethereum/go-ethereum/p2p/enode.(*FairMix).Close(0xc0004bfea0) github.com/ethereum/go-ethereum/p2p/enode/iter.go:379 +0xb7 github.com/ethereum/go-ethereum/eth.(*Ethereum).Stop(0xc000997b00) github.com/ethereum/go-ethereum/eth/backend.go:960 +0x4a github.com/ethereum/go-ethereum/node.(*Node).stopServices(0xc0001362a0, {0xc012e16330, 0x1, 0xc000111410?}) github.com/ethereum/go-ethereum/node/node.go:333 +0xb3 github.com/ethereum/go-ethereum/node.(*Node).Close(0xc0001362a0) github.com/ethereum/go-ethereum/node/node.go:263 +0x167 created by github.com/ethereum/go-ethereum/cmd/utils.StartNode.func1.1 in goroutine 9729 github.com/ethereum/go-ethereum/cmd/utils/cmd.go:101 +0x78 ``` The rootcause of the hang is caused by the extra 1 slot, which was designed to make sure the routines in `AsyncFilter(...)` can be finished. This PR fixes it by making sure the extra 1 shot can always be resumed when node shutdown.
This pr implements ethereum/go-ethereum#32733 to make StateProcessor more customisable. ## Compatibility notes This introduces a breaking change to users using geth EVM as a library. The `NewStateProcessor` function now takes one parameter which has the chainConfig embedded instead of 2 parameters.
just finisher the sentence Signed-off-by: Csaba Kiraly <[email protected]>
It uses the slices.Concat and slices.Clone methods available now in Go.
Adds blockTimestamp to the logs in response of eth_simulateV1. --------- Co-authored-by: Sina Mahmoodi <[email protected]>
This PR does a few things: - Sets the gh actions runner sizes for lint (s) and test (l) workflows - Runs the tests on gh actions in parallel - Skips fetching the spec tests when unnecessary (on windows in appveyor) - Removes ubuntu appveyor runner since it's essentially duplicate of the gh action workflow now The gh test seems to go down from ~35min to ~13min.
This PR adds a `filterfuzz` subcommand to the workload tester that generates requests similarly to `filtergen` (though with a much smaller block length limit) and also verifies the results by retrieving all block receipts in the range and locally filtering out relevant results. Unlike `filtergen` that operates on the finalized chain range only, `filterfuzz` does check the head region, actually it seeds a new query at every new chain head.
This ensures the node is ready to accept other nodes into the table before it is used in a test. Closes #32863
The limit check for `MaxUint32` is done after the cast to `int`. On 64 bits machines, that will work without a problem. On 32 bits machines, that will always fail. The compiler catches it and refuses to build. Note that this only fixes the compiler build. ~~If the limit is above `MaxInt32` but strictly below `MaxUint32` then this will fail at runtime and we have another issue.~~ I checked and this should not happen during regular execution, although it might happen in tests.
This happens normally after a restart, so it is better to use Info level here. Signed-off-by: Csaba Kiraly <[email protected]>
This pr addresses a few issues brought by the #32270 - Add updates to pricedList after dropping transactions. - Remove redundant deletions in queue.evictList, since pool.removeTx(hash, true, true) already performs the removal. - Prevent duplicate addresses during promotion when Reset is not nil.
…oceeding with transfer (#32374) remove todo
…#32849) This adds a temporary conversion path for blob transactions with legacy proof sidecar. This feature will activate after Fusaka. We will phase this out when the fork has sufficiently settled and client side libraries have been upgraded to send the new proofs.
…peer (#32728) Drop peer if sending the same transaction multiple times in a single message. Fixes ethereum/go-ethereum#32724 --------- Signed-off-by: Csaba Kiraly <[email protected]> Co-authored-by: Gary Rong <[email protected]> Co-authored-by: Csaba Kiraly <[email protected]>
This fixes a regression introduced in #32518. In that PR, we removed the slowdown logic that would throttle lookups when the table runs empty. Said logic was originally added in #20389. Usually it's fine, but there exist pathological cases, such as hive tests, where the node can only discover one other node, so it can only ever query that node and won't get any results. In cases like these, we need to throttle the creation of lookups to avoid crazy CPU usage.
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
| } | ||
| pool.priced = newPricedList(pool.all) | ||
|
|
||
| pool.queue.withRollupCostFnProvider(pool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new queue abstraction was introduced upstream that complicates how we pass the rollup cost function into the list. I ended up passing the rollupCostFnProvider (the pool) down into the queue as seen here.
| // ToJournal returns all transactions in the pool in a format suitable for journaling. | ||
| // | ||
| // OP-Stack addition. | ||
| func (pool *LegacyPool) ToJournal() map[common.Address]types.Transactions { | ||
| pool.mu.Lock() | ||
| defer pool.mu.Unlock() | ||
|
|
||
| txs := make(map[common.Address]types.Transactions, len(pool.pending)+len(pool.queue)) | ||
| txs := make(map[common.Address]types.Transactions, len(pool.pending)+len(pool.queue.queued)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this function @sebastianst?
| // storedReceiptRLP is the storage encoding of a receipt. | ||
| // Re-definition in core/types/receipt.go. | ||
| // TODO: Re-use the existing definition. | ||
| type storedReceiptRLP struct { | ||
| PostStateOrStatus []byte | ||
| CumulativeGasUsed uint64 | ||
| Logs []*types.Log | ||
|
|
||
| // Remaining fields are declared to allow the receipt RLP to be parsed without errors. | ||
| // However, they must not be used as they may not be populated correctly due to multiple receipt formats | ||
| // being combined into a single list of optional fields which can be mistaken for each other. | ||
| // DepositNonce (*uint64) from Regolith deposit tx receipts will be parsed into L1GasUsed | ||
| L1GasUsed *big.Int `rlp:"optional"` // OVM legacy | ||
| L1GasPrice *big.Int `rlp:"optional"` // OVM legacy | ||
| L1Fee *big.Int `rlp:"optional"` // OVM legacy | ||
| FeeScalar string `rlp:"optional"` // OVM legacy | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a risky change that wouldn't get caught in our usual smoke tests in the event of a bug. Should we also full sync on OPM prior to finalizing a release?
04fb1c5 to
36015e2
Compare
| if c.AmsterdamTime != nil { | ||
| banner += fmt.Sprintf(" - Amsterdam: @%-10v blob: (%s)\n", *c.AmsterdamTime, c.BlobScheduleConfig.Amsterdam) | ||
| } | ||
| if c.VerkleTime != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream includes this line, which I removed since it intuitively seemed like the right thing to do. We could print it and a link to our specs but I think it might overcomplicate the diff.
36015e2 to
9199c60
Compare
| blobScheduleConfig := c.BlobScheduleConfig | ||
| if c.BlobScheduleConfig == nil { // will occur when IsOptimism(). | ||
| blobScheduleConfig = &BlobScheduleConfig{} | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff in the rest of the function that results from this change is unfortunate.
We could do something like:
if c.BlobScheduleConfig == nil {
c.BlobScheduleConfig = &BlobScheduleConfig{}
defer func() {
c.BlobScheduleConfig = nil
}()
}but it's not goroutine-safe.
I'm open to other ideas.
9199c60 to
b46f1ab
Compare
Monorepo PR: ethereum-optimism/optimism#18337