Skip to content

Commit

Permalink
Merge pull request #6 from EspressoSystems/set-chain-config
Browse files Browse the repository at this point in the history
Set chain config
  • Loading branch information
zacshowa authored Sep 25, 2024
2 parents 751be3f + a6d8f31 commit 4453e23
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
20 changes: 20 additions & 0 deletions migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,23 @@ On the parent chain you need to call the `perform()` function on the EspressoArb
```
cast send $CHILD_CHAIN_UPGRADE_EXECUTOR_ADDRESS "execute(address, bytes)" $ARBOS_UPGRADE_ACTION $(cast calldata "perform()") --rpc-url $CHILD_CHAIN_RPC_URL --private-key $PRIVATE_KEY
```

## Enabling Espresso STF behavior

To enable the behavior in the STF that provides compatibility with the Espresso network, you must send a request (via cast) to the `ArbOwner` precompile to update your networks chain config.

There is an example chain config json file in the same directory as this README to show which fields need to be added to the standard Arbitrum chain config.

Ensure that values other than the new Espresso field are the same values as they are in your current chain config. It is **incredibly important** that the node with espresso compatible code is loaded with a chain config that contains the `EnableEspresso` flag inside the arbitrum chain parameters. If the config doesn't contain this flag, attempting to set the chain config in the following manner will cause the delegated call from the `UpgradeExecutor` to revert.

The request to the ArbOwner precompile must come from an address designated as a chain owner. Typically this is the `UpgradeExecutor`.

The following command uses cast and the `UpgradeExecutor` to send the new chain config to the network.

Note: The address 0x0000000000000000000000000000000000000070 is the hard-coded address of the ArbOwner precompile on arbitrum derived chains.


```
cast send $CHILD_CHAIN_UPGRADE_EXECUTOR_ADDRESS "execute(address, bytes)" 0x0000000000000000000000000000000000000070 $(cast calldata "setChainConfig(string)" "$(cat /chain/config/location)") --rpc-url $CHILD_CHAIN_RPC_URL --private-key $PRIVATE_KEY
```

29 changes: 29 additions & 0 deletions migration/example-chain-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"chainId":412346,
"homesteadBlock":0,
"daoForkSupport":true,
"eip150Block":0,
"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block":0,
"eip158Block":0,
"byzantiumBlock":0,
"constantinopleBlock":0,
"petersburgBlock":0,
"istanbulBlock":0,
"muirGlacierBlock":0,
"berlinBlock":0,
"londonBlock":0,
"clique":{
"period":0,
"epoch":0
},
"arbitrum":{
"EnableArbOS":true,
"AllowDebugPrecompiles":true,
"DataAvailabilityCommittee":false,
"InitialArbOSVersion":30,
"InitialChainOwner":"0x0000000000000000000000000000000000000000",
"GenesisBlockNum":0,
"EnableEspresso":true
}
}

0 comments on commit 4453e23

Please sign in to comment.