-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define a genesis config file (#1443)
This aims to separate onchain data, which must be the same for all nodes (chain ID, base fee, etc) from node-specific configuration. Node configuration continues to be done via environment variables, whereas onchain data is defined in a configuration file which we can distribute to all node operators when launching a network. This should greatly simplify coordination and reduce the frequency of errors due to misconfigured nodes. For officially supported networks (demo, staging, testnet, and eventually mainnet) the genesis file is distributed via the sequencer docker image itself, which makes the deployment process far less error prone -- the only thing we need to get right is to ensure all node operators are using the same Docker tag. It is also a bit easier to toggle between networks now, as you can switch over all the onchain data just by changing `ESPRESSO_SEQUENCER_GENESIS_FILE` to a different bundled genesis file. You still have to change the other env vars to connect to the right orchestrator, CDN, etc though. # Key places to review * Changes in `genesis.rs` and `options.rs` are the meat of the change * Serialization changes (to allow flexible deserialization from string or integer) in `utils/src/ser.rs`, `sequencer/src/state.rs`, and `sequencer/src/chain_config.rs`. In particular check the new tests, that are intended to prove this is backwards compatible with Cappuccino serialization * Changes to `docker-compose.yaml` and `process-compose.yaml`
- Loading branch information
Showing
32 changed files
with
816 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[stake_table] | ||
capacity = 200 | ||
|
||
[chain_config] | ||
chain_id = 0 | ||
base_fee = '0 wei' | ||
max_block_size = '30mb' | ||
fee_recipient = '0x0000000000000000000000000000000000000000' | ||
|
||
[header] | ||
timestamp = "1970-01-01T00:00:00Z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[stake_table] | ||
capacity = 10 | ||
|
||
[chain_config] | ||
chain_id = 999999999 | ||
base_fee = '1 wei' | ||
max_block_size = '1mb' | ||
fee_recipient = '0x0000000000000000000000000000000000000000' | ||
fee_contract = '0xa15bb66138824a1c7167f5e85b957d04dd34e468' | ||
|
||
[header] | ||
timestamp = "1970-01-01T00:00:00Z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[stake_table] | ||
capacity = 10 | ||
|
||
[chain_config] | ||
chain_id = 888888888 | ||
base_fee = '0 wei' | ||
max_block_size = '1mb' | ||
fee_recipient = '0x0000000000000000000000000000000000000000' | ||
|
||
[header] | ||
timestamp = "1970-01-01T00:00:00Z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.