Repository navigation
Rebase the main patch onto current erigon - #45
Conversation
The main patch stopped applying after erigon main moved precompile gas to MdGas, folded the CREATE gas functions into initCodeGas, returned MdGasCost from gas functions, dropped the chain config argument from Ethereum.Init and replaced AA transactions with EIP-8141 frames. - RunPrecompiledContract takes the gas schedule again, and the identity fast path in runPrecompile applies precompile overrides too. - memoryGasCost takes the EVM again; initCodeGas and the cached-slot SLOAD path read the schedule like the code they replaced. - Xatu is initialised from the chain config Ethereum keeps. - evmSizeClass moves to 512: GasSchedule and Config.CustomJumpTable add a pointer each, and EVM has no padding to hold them. - CalcCustomIntrinsicGas loses its isAATxn argument. Every caller passed false, and params.TxAAGas no longer exists on main. - The overlay builds the message and tx context itself, because transactions.ComputeTxContext lost two arguments on main but not in the v3.7 and v3.8 releases that share the main overlay. - The tracer test mock implements HasSelfdestructed, which main added to tracing.IntraBlockState. Co-authored-by: Sam Calder-Mason <samcaldermason@gmail.com>
There was a problem hiding this comment.
This PR rebases the erigon integration patch (plus the shared overlay and version-specific patch call sites) onto current erigon main. I verified the mechanical parts against real upstream source: the main patch applies cleanly to erigontech/erigon at 61c2c00, the new local computeTxContext helper reproduces transactions.ComputeTxContext byte-for-byte in main, v3.7.1 and v3.8.1 (the engine/chain-config arguments were genuinely unused there), the folded initCodeGas keeps the CREATE2 keccak and EIP-3860 init-code-word overrides that the three removed gas functions had, the new cached-slot SLOAD path keeps the warm/cold overrides, and every GasKey* override key still has a live use. No behavioural regression found; the delta reads as a faithful rebase.
Reviewed 12 changed file(s) @ 1cd18c2f — no blocking issues found.
"Design is how it works." — Steve Jobs
- Updated patches for erigontech/erigon v3.3.10 (commit: e7de183) - Updated patches for erigontech/erigon v3.7.0 (commit: bdc78cc) - Updated patches for erigontech/erigon v3.7.1 (commit: 8c1e389) - Updated patches for erigontech/erigon v3.8.0 (commit: 7539da1) - Updated patches for erigontech/erigon v3.8.1 (commit: cf6f141)
Docker Image Built (main)Multi-architecture (amd64/arm64) image has been built and pushed to Docker Hub: Repository:
Usagedocker pull ethpandaops/erigone:pr-45-1cd18c2-main
docker run ethpandaops/erigone:pr-45-1cd18c2-main --help |
Docker Image Built (v3.3.10)Multi-architecture (amd64/arm64) image has been built and pushed to Docker Hub: Repository:
Usagedocker pull ethpandaops/erigone:pr-45-1cd18c2-v3.3.10
docker run ethpandaops/erigone:pr-45-1cd18c2-v3.3.10 --help |
Docker Image Built (v3.7.0)Multi-architecture (amd64/arm64) image has been built and pushed to Docker Hub: Repository:
Usagedocker pull ethpandaops/erigone:pr-45-1cd18c2-v3.7.0
docker run ethpandaops/erigone:pr-45-1cd18c2-v3.7.0 --help |
Docker Image Built (v3.7.1)Multi-architecture (amd64/arm64) image has been built and pushed to Docker Hub: Repository:
Usagedocker pull ethpandaops/erigone:pr-45-1cd18c2-v3.7.1
docker run ethpandaops/erigone:pr-45-1cd18c2-v3.7.1 --help |
Docker Image Built (v3.8.0)Multi-architecture (amd64/arm64) image has been built and pushed to Docker Hub: Repository:
Usagedocker pull ethpandaops/erigone:pr-45-1cd18c2-v3.8.0
docker run ethpandaops/erigone:pr-45-1cd18c2-v3.8.0 --help |
Docker Image Built (v3.8.1)Multi-architecture (amd64/arm64) image has been built and pushed to Docker Hub: Repository:
Usagedocker pull ethpandaops/erigone:pr-45-1cd18c2-v3.8.1
docker run ethpandaops/erigone:pr-45-1cd18c2-v3.8.1 --help |
The main patch no longer applies to erigon main (cmd/utils/flags.go, execution/vm and node/eth/backend.go conflict), so the daily patch check fails for
mainand releases build no-mainimage. This rebases the existing changes onto current main without adding behaviour.Upstream changes the patch now follows:
MdGas, and identity output goes through a newrunPrecompilefast path.RunPrecompiledContracttakes the gas schedule again, and the fast path applies precompile overrides as well.MdGasCost, and the three CREATE gas functions are folded intoinitCodeGas.memoryGasCosttakes the EVM again, andinitCodeGasand the new cached-slot SLOAD path read the schedule like the code they replaced.Ethereum.Initno longer takes the chain config, so Xatu is initialised from the chain configEthereumkeeps.TestEVMFitsItsSizeClasslimitsEVMto 480 bytes.GasScheduleandConfig.CustomJumpTableadd a pointer each andEVMhas no padding for them, soevmSizeClassmoves to 512.Overlay changes needed to build against main:
params.TxAAGasis gone (AA transactions became EIP-8141 frames).CalcCustomIntrinsicGasloses itsisAATxnargument, which every caller passed asfalse. The call in each tagged patch drops the argument as well.transactions.ComputeTxContextlost its engine and chain config arguments on main but not in v3.7.x and v3.8.x, which share themainoverlay. The overlay now builds the message and tx context itself, the same way that function does.HasSelfdestructed, which main added totracing.IntraBlockState.Checked against erigon main at 61c2c00:
go vetpasses fornode/xatu,node/eth,execution/vm,execution/protocolandcmd/utilswith the release build tags.go test ./execution/vm/ ./execution/protocol/ ./node/xatu/passes.validate-patch.shpasses for every patch.