Skip to content

Commit

Permalink
vm: update the beacon block root contract address (#3003)
Browse files Browse the repository at this point in the history
* vm: update the beacon block root contract address

* fix spec
  • Loading branch information
g11tech authored Sep 1, 2023
1 parent f94accb commit 6319b87
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/client/test/rpc/engine/getPayloadV3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/rpc/engine/newPayloadV3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/runBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const { debug: createDebugLogger } = debugDefault
const debug = createDebugLogger('vm:block')

const parentBeaconBlockRootAddress = Address.fromString(
'0x000000000000000000000000000000000000000b'
'0xbEac00dDB15f3B6d645C48263dC93862413A222D'
)

/**
Expand Down
11 changes: 9 additions & 2 deletions packages/vm/test/api/EIPs/eip-4788-beaconroot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6319b87

Please sign in to comment.