From 6319b87eb2558c942b5747e600305ddb45ae727d Mon Sep 17 00:00:00 2001 From: g11tech Date: Fri, 1 Sep 2023 17:48:55 +0530 Subject: [PATCH] vm: update the beacon block root contract address (#3003) * vm: update the beacon block root contract address * fix spec --- packages/client/test/rpc/engine/getPayloadV3.spec.ts | 2 +- packages/client/test/rpc/engine/newPayloadV3.spec.ts | 4 ++-- packages/vm/src/runBlock.ts | 2 +- packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts | 11 +++++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/client/test/rpc/engine/getPayloadV3.spec.ts b/packages/client/test/rpc/engine/getPayloadV3.spec.ts index 656abb2468..37c8efbabb 100644 --- a/packages/client/test/rpc/engine/getPayloadV3.spec.ts +++ b/packages/client/test/rpc/engine/getPayloadV3.spec.ts @@ -124,7 +124,7 @@ describe(method, () => { const { executionPayload, blobsBundle } = res.body.result assert.equal( executionPayload.blockHash, - '0x0a4f946a9dac3f6d2b86d02dfa6cf221b4fe72bbaff51b50cee4c5784156dd52', + '0xe085c4203edf3c9437b41ff43dabe4918a0f496d04217768f0f50e501cd0721a', 'built expected block' ) assert.equal(executionPayload.excessBlobGas, '0x0', 'correct execess blob gas') diff --git a/packages/client/test/rpc/engine/newPayloadV3.spec.ts b/packages/client/test/rpc/engine/newPayloadV3.spec.ts index a23a905dc7..bb5498f511 100644 --- a/packages/client/test/rpc/engine/newPayloadV3.spec.ts +++ b/packages/client/test/rpc/engine/newPayloadV3.spec.ts @@ -63,8 +63,8 @@ describe(`${method}: call with executionPayloadV3`, () => { withdrawals: [], blobGasUsed: '0x0', excessBlobGas: '0x0', - blockHash: '0x6ec6f32e6931199f8f84faf46a59bc9a1e65a23aa73ca21278b5cb48aa2d059d', - stateRoot: '0x454a9db6943b17a5f88aea507d0c3f4420d533d143b4eb5194cc7589d721b024', + blockHash: '0x80d8858cfe4387e29e1853ad6e028cd9c8a40739416c93c2ae0c04410ebeee3c', + stateRoot: '0x3c49a0c1f34b6e0ad9b04deb44bcc459f1c8d994214ce907ff2682ffe779a31a', } let expectRes, req diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 92bcc4c87f..50b78a42ba 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -37,7 +37,7 @@ const { debug: createDebugLogger } = debugDefault const debug = createDebugLogger('vm:block') const parentBeaconBlockRootAddress = Address.fromString( - '0x000000000000000000000000000000000000000b' + '0xbEac00dDB15f3B6d645C48263dC93862413A222D' ) /** diff --git a/packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts b/packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts index 39e5252582..926e51936c 100644 --- a/packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts +++ b/packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts @@ -84,10 +84,17 @@ function beaconrootBlock( * Then it returns the data the precompile returns */ -const CODE = '0x365F5F375F5F365F5F600B5AF15F553D5F5F3E3D5FF3' +const BROOT_AddressString = 'bEac00dDB15f3B6d645C48263dC93862413A222D' +const CODE = + '0x365F5F375F5F365F5F' + + // push broot contract address on stack + '73' + + BROOT_AddressString + + // remaining contract + '5AF15F553D5F5F3E3D5FF3' const BROOT_CODE = '0x3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b42620180004206555f3562018000420662018000015500' -const BROOT_Address = Address.fromString('0x' + '00'.repeat(19) + '0b') +const BROOT_Address = Address.fromString(`0x${BROOT_AddressString}`) /** * Run a block inside a 4788 VM