Merged
Conversation
This fixes a regression in the opcode tracer API where we would log empty memory and storage fields.
Slightly improves performance of abi.Unpack ``` Before BenchmarkUnpack/0-14 5965714 210.9 ns/op 280 B/op 5 allocs/op BenchmarkUnpack/1-14 2148283 569.7 ns/op 688 B/op 16 allocs/op After: BenchmarkUnpack/0-14 7693365 151.2 ns/op 136 B/op 4 allocs/op BenchmarkUnpack/1-14 2261294 508.9 ns/op 544 B/op 15 allocs/op ``` replaces ethereum/go-ethereum#31292 since I was unable to push to your branch @Exca-DK --------- Co-authored-by: Exca-DK <dawidk.info@gmail.com>
Currently, even though it takes in a `Logger` interface, `log.SetDefualt` enforces that the concrete type of the provided logger is `*logger` because: 1. in `init` `root.Store` is called with a `*logger` 2. `atomic.Value` panics if the concrete type provided in `Store` is not consistent across calls. ([ref](https://pkg.go.dev/sync/atomic#Value.Store)) > All calls to Store for a given Value must use values of the same concrete type. This PR changes to use `sync.RWMutex` and adds a test that panics on `master`.
…c block (#27508) The main use case I see of this is that it allows users to estimate gas against the same state that they query for their nonce, and the same state they base the data of their transaction against. This helps ensure that gas estimation won't fail and the transaction won't revert on-chain because of a mismatch between the state used for gas estimation and the state used to generate the inputs to gas estimation or the transaction's nonce when submitted to the mempool. This PR also updates the EstimateGas comment based on the new geth `eth_estimateGas` default of using latest state as of v1.12.0: ethereum/go-ethereum#24363 --------- Co-authored-by: Felix Lange <fjl@twurst.com>
This PR roughly halves the number of allocations needed to compute the
sigHash for a transaction.
This sigHash is used whenever we recover a signature of a transaction,
so quite often. During a recent benchmark full syncing on Holesky,
roughly 2.8% of all allocations were happening here because the fields
from the transaction would be copied multiple times.
```
66168733 153175654 (flat, cum) 2.80% of Total
. . 368:func (s londonSigner) Hash(tx *Transaction) common.Hash {
. . 369: if tx.Type() != DynamicFeeTxType {
. . 370: return s.eip2930Signer.Hash(tx)
. . 371: }
. 19169966 372: return prefixedRlpHash(
. . 373: tx.Type(),
26442187 26442187 374: []interface{}{
. . 375: s.chainId,
6848616 6848616 376: tx.Nonce(),
. 19694077 377: tx.GasTipCap(),
. 18956774 378: tx.GasFeeCap(),
6357089 6357089 379: tx.Gas(),
. 12321050 380: tx.To(),
. 16865054 381: tx.Value(),
13435187 13435187 382: tx.Data(),
13085654 13085654 383: tx.AccessList(),
. . 384: })
. . 385:}
```
This PR reduces the allocations and speeds up the computation of the
sigHash by ~22%, which is quite significantly given that this operation
involves a call to Keccak
```
// BenchmarkHash-8 440082 2639 ns/op 384 B/op 13 allocs/op
// BenchmarkHash-8 493566 2033 ns/op 240 B/op 6 allocs/op
```
```
Hash-8 2.691µ ± 8% 2.097µ ± 9% -22.07% (p=0.000 n=10)
```
It also kinda cleans up stuff in my opinion, since the transaction
should itself know best how to compute the sighash

---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This pull request improves the protection mechanism in the txpool for senders with delegation. A sender with either delegation or pending delegation is now limited to a maximum of one in-flight executable transaction, while gapped transactions will be rejected. Reason: If nonce-gapped transaction from delegated/pending-delegated senders can be acceptable, then it's no-longer possible to send another "executable" transaction with correct nonce due to the policy of at most one inflight tx. The gapped transaction will be stuck in the txpool, with no meaningful way to unlock the sender. --------- Co-authored-by: lightclient <lightclient@protonmail.com>
… reason was not returned (#31456)
…cessList (#31336) closes ethereum/go-ethereum#31335 --------- Co-authored-by: sashabeton <sashabeton2007@gmail.com>
Simple bugfix to include the access-list in the gas-estimation step of the ABI bindings code.
Add support for state overrides in eth_createAccessList. This will make the method consistent with other execution methods. --------- Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
During my benchmarks on Holesky, around 10% of all CPU time was spent in
PUSH2
```
ROUTINE ======================== github.com/ethereum/go-ethereum/core/vm.newFrontierInstructionSet.makePush.func1 in github.com/ethereum/go-ethereum/core/vm/instructions.go
16.38s 20.35s (flat, cum) 10.31% of Total
740ms 740ms 976: return func(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
. . 977: var (
40ms 40ms 978: codeLen = len(scope.Contract.Code)
970ms 970ms 979: start = min(codeLen, int(*pc+1))
200ms 200ms 980: end = min(codeLen, start+pushByteSize)
. . 981: )
670ms 2.39s 982: a := new(uint256.Int).SetBytes(scope.Contract.Code[start:end])
. . 983:
. . 984: // Missing bytes: pushByteSize - len(pushData)
410ms 410ms 985: if missing := pushByteSize - (end - start); missing > 0 {
. . 986: a.Lsh(a, uint(8*missing))
. . 987: }
12.69s 14.94s 988: scope.Stack.push2(*a)
10ms 10ms 989: *pc += size
650ms 650ms 990: return nil, nil
. . 991: }
. . 992:}
```
Which is quite crazy. We have a handwritten encoder for PUSH1 already,
this PR adds one for PUSH2.
PUSH2 is the second most used opcode as shown here:
https://gist.github.com/shemnon/fb9b292a103abb02d98d64df6fbd35c8 since
it is used by solidity quite significantly. Its used ~20 times as much
as PUSH20 and PUSH32.
# Benchmarks
```
BenchmarkPush/makePush-14 94196547 12.27 ns/op 0 B/op 0 allocs/op
BenchmarkPush/push-14 429976924 2.829 ns/op 0 B/op 0 allocs/op
```
---------
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
This PR adds the `AuthorizationList` field to the `CallMsg` interface to support `eth_call` and `eth_estimateGas` of set-code transactions. --------- Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com> Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
upstream: pick bugfix and feature from latest geth v1.5.9
This file appears to have been unintentionally added in #2247.
expected Testnet Maxwell hard fork time: 2025-05-26 07:05:00 AM UTC
buddh0
approved these changes
May 16, 2025
zlacfzy
approved these changes
May 16, 2025
alex-10072
approved these changes
May 16, 2025
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.
Description
v1.5.13 is for BSC Testnet Maxwell hard fork, which is expected to be enabled at:
2025-05-26 07:05:00 AM UTC, all BSC Testnet nodes need to be upgraded to v1.5.13 before the hard fork time. For this upgrade, simply binary replacement should be enough.Maxwell includes 3 BEPs, mainly to reduce block interval from 1.5 seconds to 0.75 seconds:
Besides the 0.75 seconds block interval update, there are several other key parameters will be updated:
Beside hard fork changes, there are several other items:
For details, pls refer the change log.
ChangeLog
FEATURE
#3019 BEP-524: Short Block Interval Phase Two: 0.75 seconds
#3044 params: double FullImmutabilityThreshold for BEP-520 & BEP-524
#3045 Feature: StakeHub Contract Interface Implementation
#3040 bsc: add new block fetching mechanism
#3043 p2p: support new msg broadcast features
#3070 chore: renaming for evn and some optmization
#3073 evn: add support for node id removal
#3072 config: support more evn configuration in tool
#3075 config: apply two default miner option
#3083 evn: improve node ID management with better error handling
#3084 metrics: add more monitor metrics for EVN
#3087 bsc2: fix block sidecar fetching issue
#3090 chore: update maxwell contrats addresses
#3091 chore: fix several occasional issues for EVN
#3049 upstream: pick bugfix and feature from latest geth v1.5.9
#3096 config: update BSC Testnet hardfork time: Maxwell
BUGFIX
#3050 miner: fix memory leak caused by no discard env
#3061 p2p: fix bscExt checking logic
#3085 miner: fix goroutine leak
IMPROVEMENT
#3034 miner: optimize clear up logic for envs
#3039 Revert "miner: limit block size to eth protocol msg size (#2696)"
#3041 feat: add json-rpc-api.md
#3057 eth/protocols/bsc: adjust vote reception limit
#3067 ethclient/gethclient: add deduplication and max keys limit to GetProof
#3063 rpc: add method name length limit and configurable message size limit
#3077 performance: track large tx execution cost
#3074 jsutils: add tool GetLargeTxs
#3082 metrics: optimize mev metrics
#3081 miner: reset recommit timer on new block
#3062 refactor: use slices.Contains to simplify code
#3088 core/vote: change waiting blocks for voting since start mining
#3089 core/systemcontracts: remove lorentz/rialto