-
Notifications
You must be signed in to change notification settings - Fork 21.6k
core/{.,state,vm},miner,eth/tracers,tests: implement 7709 with a syscall flag #31036
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
Changes from all commits
90e5325
c1c1ba0
35313fd
3ad0d18
584f277
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,7 +85,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg | |
| if beaconRoot := block.BeaconRoot(); beaconRoot != nil { | ||
| ProcessBeaconBlockRoot(*beaconRoot, evm) | ||
| } | ||
| if p.config.IsPrague(block.Number(), block.Time()) { | ||
| if p.config.IsPrague(block.Number(), block.Time()) || p.config.IsVerkle(block.Number(), block.Time()) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The It's unnecessary to add this condition here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that is not the case on verkle testnets as long as all of the code has been merged.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah... It's annoying I agree...
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't understand this. can you elaborate a bit?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because merging my branch into geth takes forever, there is a testnet that exists, that has verkle enabled but not prague. We want to support that testnet as a first step, to confirm what has been merged is working. |
||
| ProcessParentBlockHash(block.ParentHash(), evm) | ||
| } | ||
|
|
||
|
|
@@ -155,6 +155,12 @@ func ApplyTransactionWithEVM(msg *Message, gp *GasPool, statedb *state.StateDB, | |
| } | ||
| *usedGas += result.UsedGas | ||
|
|
||
| // Merge the tx-local access event into the "block-local" one, in order to collect | ||
| // all values, so that the witness can be built. | ||
| if statedb.GetTrie().IsVerkle() { | ||
| statedb.AccessEvents().Merge(evm.AccessEvents) | ||
| } | ||
|
|
||
| return MakeReceipt(evm, result, statedb, blockNumber, blockHash, tx, *usedGas, root), nil | ||
| } | ||
|
|
||
|
|
@@ -181,12 +187,6 @@ func MakeReceipt(evm *vm.EVM, result *ExecutionResult, statedb *state.StateDB, b | |
| receipt.ContractAddress = crypto.CreateAddress(evm.TxContext.Origin, tx.Nonce()) | ||
| } | ||
|
|
||
| // Merge the tx-local access event into the "block-local" one, in order to collect | ||
| // all values, so that the witness can be built. | ||
| if statedb.GetTrie().IsVerkle() { | ||
| statedb.AccessEvents().Merge(evm.AccessEvents) | ||
| } | ||
|
|
||
| // Set the receipt logs and create the bloom filter. | ||
| receipt.Logs = statedb.GetLogs(tx.Hash(), blockNumber.Uint64(), blockHash) | ||
| receipt.Bloom = types.CreateBloom(types.Receipts{receipt}) | ||
|
|
@@ -234,7 +234,7 @@ func ProcessBeaconBlockRoot(beaconRoot common.Hash, evm *vm.EVM) { | |
| } | ||
|
|
||
| // ProcessParentBlockHash stores the parent block hash in the history storage contract | ||
| // as per EIP-2935. | ||
| // as per EIP-2935/7709. | ||
| func ProcessParentBlockHash(prevHash common.Hash, evm *vm.EVM) { | ||
| if tracer := evm.Config.Tracer; tracer != nil { | ||
| onSystemCallStart(tracer, evm.GetVMContext()) | ||
|
|
@@ -253,7 +253,13 @@ func ProcessParentBlockHash(prevHash common.Hash, evm *vm.EVM) { | |
| } | ||
| evm.SetTxContext(NewEVMTxContext(msg)) | ||
| evm.StateDB.AddAddressToAccessList(params.HistoryStorageAddress) | ||
| _, _, _ = evm.Call(vm.AccountRef(msg.From), *msg.To, msg.Data, 30_000_000, common.U2560) | ||
| _, _, err := evm.Call(vm.AccountRef(msg.From), *msg.To, msg.Data, 30_000_000, common.U2560) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| if evm.StateDB.AccessEvents() != nil { | ||
| evm.StateDB.AccessEvents().Merge(evm.AccessEvents) | ||
| } | ||
| evm.StateDB.Finalise(true) | ||
| } | ||
|
|
||
|
|
||
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 is the best way I found to force the rules to accept that this is a merged network, happy to get some input in here.