Skip to content

Commit 6e53fce

Browse files
committed
add ivc spec test in end to end client spec and debug and fix it
1 parent e8ff671 commit 6e53fce

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

packages/client/test/rpc/engine/newPayloadEip6493.spec.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createTx } from '@ethereumjs/tx'
2-
import { bigIntToHex, hexToBytes } from '@ethereumjs/util'
2+
import { bigIntToAddressBytes, bigIntToHex, bytesToHex, hexToBytes } from '@ethereumjs/util'
33
import { assert, describe, it } from 'vitest'
44

55
import { beaconData } from '../../testdata/blocks/beacon.js'
@@ -60,7 +60,7 @@ describe(`${method}: call with executionPayloadV4`, () => {
6060
depositRequests: [],
6161
withdrawalRequests: [],
6262
consolidationRequests: [],
63-
receiptsRoot: "0x7ffe241ea60187fdb0187bfa22de35d1f9bed7ab061d9401fd47e34a54fbede1",
63+
receiptsRoot: '0x7ffe241ea60187fdb0187bfa22de35d1f9bed7ab061d9401fd47e34a54fbede1',
6464
parentHash: '0x5040e6b0056398536751c187683a3ecde8aff8fd9ea1d3450d687d7032134caf',
6565
stateRoot: '0xbde9840c609ffa39cae0a2c9e354ac673920fcc2a5e6faeef5b78817c7fba7dd',
6666
blockHash: '0x5e9dcd3f3e55e9dde218cad2958ef3f0f1c263a85d923d1e1d3821f96510e1dc',
@@ -137,6 +137,19 @@ describe(`${method}: call with executionPayloadV4`, () => {
137137
null,
138138
])
139139
assert.equal(res.result.payloadStatus.status, 'VALID')
140+
141+
const ivcContractHex = bytesToHex(bigIntToAddressBytes(common.param('ivcPredeployAddress')))
142+
143+
res = await rpc.request('eth_getStorageAt', [
144+
ivcContractHex,
145+
'0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5',
146+
'latest',
147+
])
148+
assert.equal(
149+
res.result,
150+
'0x020c33960f53470c2e7f78f67cdadf28800eb3d6b1c4e434dc9be7681baba37a',
151+
'ivc root at updated topic should match',
152+
)
140153
})
141154
})
142155

packages/vm/src/runTx.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ import {
1717
equalsBytes,
1818
hexToBytes,
1919
publicToAddress,
20+
setLengthLeft,
2021
short,
2122
ssz,
2223
} from '@ethereumjs/util'
2324
import debugDefault from 'debug'
2425
import { keccak256 } from 'ethereum-cryptography/keccak.js'
2526

26-
import { setLengthLeft } from '../../util/src/bytes.js'
27-
2827
import { Bloom } from './bloom/index.js'
2928
import { emitEVMProfile } from './emitEVMProfile.js'
3029

@@ -776,7 +775,7 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise<RunTxResult> {
776775

777776
async function accumulateIVCLogs(vm: VM, number: bigint, logs: Log[]) {
778777
const ivcContractAddress = new Address(
779-
bigIntToAddressBytes(vm.common.param('withdrawalRequestPredeployAddress')),
778+
bigIntToAddressBytes(vm.common.param('ivcPredeployAddress')),
780779
)
781780

782781
if ((await vm.stateManager.getAccount(ivcContractAddress)) === undefined) {
@@ -805,7 +804,6 @@ async function accumulateIVCLogs(vm: VM, number: bigint, logs: Log[]) {
805804
number,
806805
logRoot,
807806
})
808-
809807
await vm.stateManager.putStorage(ivcContractAddress, topic, newTopicRoot)
810808
}
811809
}

0 commit comments

Comments
 (0)