You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- ⏰ [L2 block verification in assertion](./packages/l2-block-verification-in-assertion/)
36
+
- ⏰ [Block verification in parent chain's assertion](./packages/block-verification-in-parent-chain-assertion/)
37
37
38
38
#### :white_check_mark: Advanced features
39
39
@@ -53,4 +53,6 @@ To do that, fill the information of your chain in the [`customNetwork.json`](./c
53
53
54
54
To obtain the information of a specific chain, you can use the method [`prepareArbitrumNetwork`](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/main/src/utils/registerNewNetwork.ts#L18) of the Orbit SDK.
55
55
56
+
You can also register multiple chains if you need to (for example, for the `l1-l3-teleport` tutorial). In that case, create an array of chain information objects in the `customNetwork.json` file.
# Block verification in an assertion posted on the parent chain
2
+
3
+
This tutorial shows how to verify whether a block of a chain has been processed as part of an RBlock assertion on its parent chain.
4
+
5
+
It uses the `Rollup` contract to find the latest confirmed (or created if configured in the script) RBlock/node, find the event that created it, and get the latest processed block hash of the child chain that's part of the assertion of that RBlock/node.
6
+
7
+
Then it checks whether the block number passed as argument was created before the latest block hash of the child chain processed.
8
+
9
+
See [./exec.js](./scripts/exec.js) for inline explanations.
10
+
11
+
## Set environment variables
12
+
13
+
Set the values shown in `.env-sample` as environmental variables. To copy it into a `.env` file:
14
+
15
+
```bash
16
+
cp .env-sample .env
17
+
```
18
+
19
+
You'll still need to edit some variables, i.e., `CHAIN_RPC` and `PARENT_CHAIN_RPC`.
20
+
21
+
Note that you can also set the environment variables in an `.env` file in the root of the monorepo, which will be available in all tutorials.
console.log(`${childChainBlockNumberToVerify} has been processed as part of the latest ${useCreatedNodeInsteadOfConfirmed ? 'created' : 'confirmed'} RBlock/node`)
84
+
}else{
85
+
console.log(`${childChainBlockNumberToVerify} has NOT been processed as part of the latest ${useCreatedNodeInsteadOfConfirmed ? 'created' : 'confirmed'} RBlock/node`)
86
+
}
87
+
console.log(`************`)
88
+
};
89
+
90
+
// Getting the transaction hash from the command arguments
91
+
if(process.argv.length<3){
92
+
console.log(`Missing block number of the child chain to verify whether it has been processed in the latest ${useCreatedNodeInsteadOfConfirmed ? 'created' : 'confirmed'} RBlock/node`)
93
+
console.log(`Usage: yarn run exec <block number>`)
0 commit comments