From dfdd0160e77e56755fa4f264ade4014e14621a30 Mon Sep 17 00:00:00 2001 From: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Date: Thu, 20 Apr 2023 19:58:25 +0800 Subject: [PATCH] chore: remove outdated genesis.json (#297) --- README.md | 7 ++----- cmd/geth/genesis_test.go | 37 ------------------------------------- genesis.json | 37 ------------------------------------- genesis_zktrie.json | 37 ------------------------------------- 4 files changed, 2 insertions(+), 116 deletions(-) delete mode 100644 genesis.json delete mode 100644 genesis_zktrie.json diff --git a/README.md b/README.md index c0e7849bb0..34a4c537e6 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,7 @@ ZK-Rollup adapts the Go Ethereum to run as Layer 2 Sequencer. The codebase is ba ### ZKTrie Storage -Another implement for storage trie, base on patricia merkle tree, has been induced. It is feasible to zk proving in the storage part. It is specified as a flag -in gensis, set `config.zktrie` to true for enabling it. Using `genesis_zktrie.json` as an example to create a L2 chain with zktrie sotrage: - -> geth init \/genesis_zktrie.json +Another implement for storage trie, base on patricia merkle tree, has been induced. It is feasible to zk proving in the storage part. It is specified as a flag in gensis, set `config.scroll.useZktrie` to true for enabling it. Notice current the snapshot would be disabled by the zktrie implement. @@ -78,7 +75,7 @@ This command will: causing it to download more data in exchange for avoiding processing the entire history of the Ethereum network, which is very CPU intensive. * Start up `geth`'s built-in interactive [JavaScript console](https://geth.ethereum.org/docs/interface/javascript-console), - (via the trailing `console` subcommand) through which you can interact using [`web3` methods](https://web3js.readthedocs.io/) + (via the trailing `console` subcommand) through which you can interact using [`web3` methods](https://web3js.readthedocs.io/) (note: the `web3` version bundled within `geth` is very old, and not up to date with official docs), as well as `geth`'s own [management APIs](https://geth.ethereum.org/docs/rpc/server). This tool is optional and if you leave it out you can always attach to an already running diff --git a/cmd/geth/genesis_test.go b/cmd/geth/genesis_test.go index 3b077bae8b..e86e1d7eed 100644 --- a/cmd/geth/genesis_test.go +++ b/cmd/geth/genesis_test.go @@ -17,15 +17,10 @@ package main import ( - "encoding/json" - "fmt" "io/ioutil" "os" "path/filepath" "testing" - - "github.com/scroll-tech/go-ethereum/common" - "github.com/scroll-tech/go-ethereum/core" ) var customGenesisTests = []struct { @@ -73,41 +68,9 @@ var customGenesisTests = []struct { }, } -func addCustomGenesis() error { - path, _ := os.Getwd() - buf, err := os.ReadFile(fmt.Sprintf("%s/%s", path[:len(path)-len("/cmd/geth")], "genesis.json")) - if err != nil { - return err - } - genesis := &core.Genesis{} - if err := json.Unmarshal(buf, genesis); err != nil { - return err - } - if len(genesis.Alloc) == 0 { - return nil - } - data := string(buf) - for addr, balance := range genesis.Alloc { - customGenesisTests = append(customGenesisTests, struct { - genesis string - query string - result string - }{ - genesis: data, - query: fmt.Sprintf("eth.getBalance('%s')", addr.String()), - result: common.Bytes2Hex(balance.Balance.Bytes()), - }) - } - - return nil -} - // Tests that initializing Geth with a custom genesis block and chain definitions // work properly. func TestCustomGenesis(t *testing.T) { - if err := addCustomGenesis(); err != nil { - t.Error(err) - } for i, tt := range customGenesisTests { // Create a temporary data directory to use and inspect later datadir := tmpdir(t) diff --git a/genesis.json b/genesis.json deleted file mode 100644 index 3e5e35ad35..0000000000 --- a/genesis.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "config": { - "chainId": 53077, - "homesteadBlock": 0, - "eip150Block": 0, - "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "berlinBlock": 0, - "londonBlock": 0, - "clique": { - "period": 15, - "epoch": 30000 - }, - "zktrie": false - }, - "nonce": "0x0", - "timestamp": "0x61bc34a0", - "extraData": "0x00000000000000000000000000000000000000000000000000000000000000004cb1ab63af5d8931ce09673ebd8ae2ce16fd65710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "gasLimit": "0x47b760", - "difficulty": "0x1", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "alloc": { - "4cb1ab63af5d8931ce09673ebd8ae2ce16fd6571": { - "balance": "0x200000000000000000000000000000000000000000000000000000000000000" - } - }, - "number": "0x0", - "gasUsed": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "baseFeePerGas": null -} \ No newline at end of file diff --git a/genesis_zktrie.json b/genesis_zktrie.json deleted file mode 100644 index 5db0f740a4..0000000000 --- a/genesis_zktrie.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "config": { - "chainId": 53077, - "homesteadBlock": 0, - "eip150Block": 0, - "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "berlinBlock": 0, - "londonBlock": 0, - "clique": { - "period": 15, - "epoch": 30000 - }, - "zktrie": true - }, - "nonce": "0x0", - "timestamp": "0x61bc34a0", - "extraData": "0x00000000000000000000000000000000000000000000000000000000000000004cb1ab63af5d8931ce09673ebd8ae2ce16fd65710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "gasLimit": "0x6691b7", - "difficulty": "0x1", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "alloc": { - "4cb1ab63af5d8931ce09673ebd8ae2ce16fd6571": { - "balance": "0x56BC75E2D63100000000000000000000000000000000000000000000000000" - } - }, - "number": "0x0", - "gasUsed": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "baseFeePerGas": null -}