-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store Optimism Config in config toml files (#510)
* capture optimism config when compressing genesis * remove submodule * move types down into superchain module * lint * pull in op-geth from ethereum-optimism/op-geth#371 * migrate existing genesis files to include default Optimism values EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: u64ptr(250) special case for base sepolia, overrides elasticity paramter to be 10 Our diff bot should pick up any mistakes in this migration, we are aiming for a net zero overall diff to the effective genesis files * zora sepolia: set EIP1559DenominatorCanyon: nil We have the actual genesis of this chain on hand, so we know the correct value of this parameter * update op-geth * remove temporary workaround code * break line for readability * move Optimism config from genesis .json.gz to chain config toml files * update op-geth * fix add-chain e2e test * update chain configs to include genesis.config.optimism field * restore indentation * fix value * just codegen * add genesis.config.optimism to devnets * just codegen * Update superchain/configs/sepolia/zora.toml * fix: rust-bindings codegen * un-nest Optimism config * update op-geth * update config files with new optimism structure * just codegen * remove duplicate data * fixup op sepolia (missed it before) * just codegen --------- Co-authored-by: refcell <[email protected]>
- Loading branch information
Showing
36 changed files
with
270 additions
and
66 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
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,24 @@ | ||
package utils | ||
|
||
import ( | ||
"encoding/json" | ||
"errors" | ||
"fmt" | ||
"os" | ||
) | ||
|
||
func LoadJSON[X any](inputPath string) (*X, error) { | ||
if inputPath == "" { | ||
return nil, errors.New("no path specified") | ||
} | ||
f, err := os.OpenFile(inputPath, os.O_RDONLY, 0) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to open file %q: %w", inputPath, err) | ||
} | ||
defer f.Close() | ||
var obj X | ||
if err := json.NewDecoder(f).Decode(&obj); err != nil { | ||
return nil, fmt.Errorf("failed to decode file %q: %w", inputPath, err) | ||
} | ||
return &obj, nil | ||
} |
Oops, something went wrong.