mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
cleanup last commit
This commit is contained in:
parent
7fa2979751
commit
94bcaa8696
1 changed files with 3 additions and 17 deletions
|
|
@ -1457,15 +1457,9 @@ func TestBALAuthCodeOverwrittenFinalRecorded(t *testing.T) {
|
||||||
|
|
||||||
// ============================== Preimages ==============================
|
// ============================== Preimages ==============================
|
||||||
|
|
||||||
// TestBALPreimagesEndToEnd verifies that BALStateTransition.Preimages collects
|
// TestBALPreimages tests that preimage tracking works when executing a block
|
||||||
// the SHA3 preimages observed during transaction execution and that they are
|
// with an access list.
|
||||||
// persisted when a post-Amsterdam block is processed through the parallel BAL
|
func TestBALPreimages(t *testing.T) {
|
||||||
// processor. Because that processor executes each transaction against its own
|
|
||||||
// statedb copy (separate from the pre/post-tx system executions), the per-tx
|
|
||||||
// preimages must be folded back into the shared state transition; here a
|
|
||||||
// transaction runs KECCAK256 over a distinctive byte and we confirm the
|
|
||||||
// preimage is written to disk on commit.
|
|
||||||
func TestBALPreimagesEndToEnd(t *testing.T) {
|
|
||||||
// Runtime code: store 0x42 at memory[0], then KECCAK256 over memory[0:1].
|
// Runtime code: store 0x42 at memory[0], then KECCAK256 over memory[0:1].
|
||||||
// PUSH1 0x42 ; PUSH1 0x00 ; MSTORE8 ; PUSH1 0x01 ; PUSH1 0x00 ; KECCAK256 ; POP ; STOP
|
// PUSH1 0x42 ; PUSH1 0x00 ; MSTORE8 ; PUSH1 0x01 ; PUSH1 0x00 ; KECCAK256 ; POP ; STOP
|
||||||
contract := common.HexToAddress("0xca11ee")
|
contract := common.HexToAddress("0xca11ee")
|
||||||
|
|
@ -1482,14 +1476,6 @@ func TestBALPreimagesEndToEnd(t *testing.T) {
|
||||||
g.SetParentBeaconRoot(common.Hash{})
|
g.SetParentBeaconRoot(common.Hash{})
|
||||||
g.AddTx(env.tx(0, &contract, big.NewInt(0), 200_000, 0, nil))
|
g.AddTx(env.tx(0, &contract, big.NewInt(0), 200_000, 0, nil))
|
||||||
})
|
})
|
||||||
block := blocks[0]
|
|
||||||
if block.AccessList() == nil {
|
|
||||||
t.Fatal("expected block to carry an access list")
|
|
||||||
}
|
|
||||||
if !env.cfg.IsAmsterdam(block.Number(), block.Time()) {
|
|
||||||
t.Fatalf("block must be post-Amsterdam: number=%v time=%d", block.Number(), block.Time())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Import the block through the parallel BAL processor with preimage
|
// Import the block through the parallel BAL processor with preimage
|
||||||
// recording enabled, so the KECCAK256 above is captured.
|
// recording enabled, so the KECCAK256 above is captured.
|
||||||
db := rawdb.NewMemoryDatabase()
|
db := rawdb.NewMemoryDatabase()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue