From c9c42f469995325d77fca75e284487571269f25f Mon Sep 17 00:00:00 2001 From: dave | d1onys1us <13951458+d1onys1us@users.noreply.github.com> Date: Thu, 9 Mar 2023 02:44:50 -0500 Subject: [PATCH 1/7] fix: integration test --- packages/protocol/test/utils/signal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/protocol/test/utils/signal.ts b/packages/protocol/test/utils/signal.ts index b535ee1b2c8..e6ce33179ad 100644 --- a/packages/protocol/test/utils/signal.ts +++ b/packages/protocol/test/utils/signal.ts @@ -61,7 +61,7 @@ async function getSignalProof( // encode the SignalProof struct from LibBridgeSignal const signalProof = ethers.utils.defaultAbiCoder.encode( [ - "tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas) header, bytes proof)", + "tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas, bytes32 withdrawalsRoot) header, bytes proof)", ], [{ header: blockHeader, proof: encodedProof }] ); From 769128476865bb79ab062a9a705843b783b10649 Mon Sep 17 00:00:00 2001 From: dave | d1onys1us <13951458+d1onys1us@users.noreply.github.com> Date: Thu, 9 Mar 2023 02:49:19 -0500 Subject: [PATCH 2/7] fix: integration test --- packages/protocol/test/utils/rpc.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/protocol/test/utils/rpc.ts b/packages/protocol/test/utils/rpc.ts index a72ee514925..48a4cc76318 100644 --- a/packages/protocol/test/utils/rpc.ts +++ b/packages/protocol/test/utils/rpc.ts @@ -37,6 +37,7 @@ type Block = { uncles: string[]; baseFeePerGas?: string; mixHash: string; + withdrawalsRoot?: string; }; type BlockHeader = { @@ -56,6 +57,7 @@ type BlockHeader = { mixHash: string; nonce: number; baseFeePerGas: number; + withdrawalsRoot: string; }; async function getBlockHeader( @@ -90,6 +92,7 @@ async function getBlockHeader( mixHash: block.mixHash, nonce: block.nonce, baseFeePerGas: block.baseFeePerGas ? parseInt(block.baseFeePerGas) : 0, + withdrawalsRoot: block.withdrawalsRoot ? block.withdrawalsRoot : "0x0", }; return { block, blockHeader }; From 557ec3c196876760e4f74ee7445f32d47412ecbe Mon Sep 17 00:00:00 2001 From: dave | d1onys1us <13951458+d1onys1us@users.noreply.github.com> Date: Thu, 9 Mar 2023 02:58:17 -0500 Subject: [PATCH 3/7] fix: integration test --- packages/protocol/test/utils/rpc.ts | 4 ++-- packages/protocol/test/utils/signal.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/protocol/test/utils/rpc.ts b/packages/protocol/test/utils/rpc.ts index 48a4cc76318..74e2425a1aa 100644 --- a/packages/protocol/test/utils/rpc.ts +++ b/packages/protocol/test/utils/rpc.ts @@ -57,7 +57,7 @@ type BlockHeader = { mixHash: string; nonce: number; baseFeePerGas: number; - withdrawalsRoot: string; + withdrawalsRoot?: string; }; async function getBlockHeader( @@ -92,7 +92,7 @@ async function getBlockHeader( mixHash: block.mixHash, nonce: block.nonce, baseFeePerGas: block.baseFeePerGas ? parseInt(block.baseFeePerGas) : 0, - withdrawalsRoot: block.withdrawalsRoot ? block.withdrawalsRoot : "0x0", + withdrawalsRoot: block.withdrawalsRoot, }; return { block, blockHeader }; diff --git a/packages/protocol/test/utils/signal.ts b/packages/protocol/test/utils/signal.ts index e6ce33179ad..71875cd042b 100644 --- a/packages/protocol/test/utils/signal.ts +++ b/packages/protocol/test/utils/signal.ts @@ -61,7 +61,9 @@ async function getSignalProof( // encode the SignalProof struct from LibBridgeSignal const signalProof = ethers.utils.defaultAbiCoder.encode( [ - "tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas, bytes32 withdrawalsRoot) header, bytes proof)", + `tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas${ + blockHeader.withdrawalsRoot ? ", bytes32 withdrawalsRoot)" : ")" + }, bytes proof)`, ], [{ header: blockHeader, proof: encodedProof }] ); From 001e46776474b9fc399b6d47b324db8c7a6ab206 Mon Sep 17 00:00:00 2001 From: dave | d1onys1us <13951458+d1onys1us@users.noreply.github.com> Date: Thu, 9 Mar 2023 03:04:16 -0500 Subject: [PATCH 4/7] fix: integration test --- packages/protocol/test/utils/signal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/protocol/test/utils/signal.ts b/packages/protocol/test/utils/signal.ts index 71875cd042b..97df5711cbd 100644 --- a/packages/protocol/test/utils/signal.ts +++ b/packages/protocol/test/utils/signal.ts @@ -63,7 +63,7 @@ async function getSignalProof( [ `tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas${ blockHeader.withdrawalsRoot ? ", bytes32 withdrawalsRoot)" : ")" - }, bytes proof)`, + } header, bytes proof)`, ], [{ header: blockHeader, proof: encodedProof }] ); From 385b4ed255927768f4a88f5723336ad0b8373c16 Mon Sep 17 00:00:00 2001 From: dave | d1onys1us <13951458+d1onys1us@users.noreply.github.com> Date: Thu, 9 Mar 2023 03:32:33 -0500 Subject: [PATCH 5/7] fix: integration test --- packages/protocol/test/utils/rpc.ts | 2 +- packages/protocol/test/utils/signal.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/protocol/test/utils/rpc.ts b/packages/protocol/test/utils/rpc.ts index 74e2425a1aa..244e55697c1 100644 --- a/packages/protocol/test/utils/rpc.ts +++ b/packages/protocol/test/utils/rpc.ts @@ -92,7 +92,7 @@ async function getBlockHeader( mixHash: block.mixHash, nonce: block.nonce, baseFeePerGas: block.baseFeePerGas ? parseInt(block.baseFeePerGas) : 0, - withdrawalsRoot: block.withdrawalsRoot, + withdrawalsRoot: ethers.constants.HashZero, }; return { block, blockHeader }; diff --git a/packages/protocol/test/utils/signal.ts b/packages/protocol/test/utils/signal.ts index 97df5711cbd..f36698eff62 100644 --- a/packages/protocol/test/utils/signal.ts +++ b/packages/protocol/test/utils/signal.ts @@ -61,9 +61,7 @@ async function getSignalProof( // encode the SignalProof struct from LibBridgeSignal const signalProof = ethers.utils.defaultAbiCoder.encode( [ - `tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas${ - blockHeader.withdrawalsRoot ? ", bytes32 withdrawalsRoot)" : ")" - } header, bytes proof)`, + `tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas, bytes32 withdrawalsRoot) header, bytes proof)`, ], [{ header: blockHeader, proof: encodedProof }] ); From f62affd8d7341aec61f73c87e53a56b238f7f882 Mon Sep 17 00:00:00 2001 From: dave | d1onys1us <13951458+d1onys1us@users.noreply.github.com> Date: Thu, 9 Mar 2023 03:34:02 -0500 Subject: [PATCH 6/7] fix: integration test --- packages/protocol/test/utils/rpc.ts | 4 ++-- packages/protocol/test/utils/signal.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/protocol/test/utils/rpc.ts b/packages/protocol/test/utils/rpc.ts index 244e55697c1..0b066dc33a0 100644 --- a/packages/protocol/test/utils/rpc.ts +++ b/packages/protocol/test/utils/rpc.ts @@ -37,7 +37,7 @@ type Block = { uncles: string[]; baseFeePerGas?: string; mixHash: string; - withdrawalsRoot?: string; + withdrawalsRoot: string; }; type BlockHeader = { @@ -57,7 +57,7 @@ type BlockHeader = { mixHash: string; nonce: number; baseFeePerGas: number; - withdrawalsRoot?: string; + withdrawalsRoot: string; }; async function getBlockHeader( diff --git a/packages/protocol/test/utils/signal.ts b/packages/protocol/test/utils/signal.ts index f36698eff62..e6ce33179ad 100644 --- a/packages/protocol/test/utils/signal.ts +++ b/packages/protocol/test/utils/signal.ts @@ -61,7 +61,7 @@ async function getSignalProof( // encode the SignalProof struct from LibBridgeSignal const signalProof = ethers.utils.defaultAbiCoder.encode( [ - `tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas, bytes32 withdrawalsRoot) header, bytes proof)`, + "tuple(tuple(bytes32 parentHash, bytes32 ommersHash, address beneficiary, bytes32 stateRoot, bytes32 transactionsRoot, bytes32 receiptsRoot, bytes32[8] logsBloom, uint256 difficulty, uint128 height, uint64 gasLimit, uint64 gasUsed, uint64 timestamp, bytes extraData, bytes32 mixHash, uint64 nonce, uint256 baseFeePerGas, bytes32 withdrawalsRoot) header, bytes proof)", ], [{ header: blockHeader, proof: encodedProof }] ); From 1751504dac7c01401834dd0956ace283f7185cc1 Mon Sep 17 00:00:00 2001 From: dave | d1onys1us <13951458+d1onys1us@users.noreply.github.com> Date: Thu, 9 Mar 2023 03:34:39 -0500 Subject: [PATCH 7/7] fix: integration test --- packages/protocol/test/utils/rpc.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/protocol/test/utils/rpc.ts b/packages/protocol/test/utils/rpc.ts index 0b066dc33a0..cdac87a5e6c 100644 --- a/packages/protocol/test/utils/rpc.ts +++ b/packages/protocol/test/utils/rpc.ts @@ -92,6 +92,7 @@ async function getBlockHeader( mixHash: block.mixHash, nonce: block.nonce, baseFeePerGas: block.baseFeePerGas ? parseInt(block.baseFeePerGas) : 0, + // set to zero for pre-shanghai L1 blocks used in the integration test node withdrawalsRoot: ethers.constants.HashZero, };