chore: remove outdated genesis.json (#297)

This commit is contained in:
HAOYUatHZ 2023-04-20 19:58:25 +08:00 committed by GitHub
parent 1abf51a719
commit dfdd0160e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 116 deletions

View file

@ -15,10 +15,7 @@ ZK-Rollup adapts the Go Ethereum to run as Layer 2 Sequencer. The codebase is ba
### ZKTrie Storage ### 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 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.
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 \<repo root\>/genesis_zktrie.json
Notice current the snapshot would be disabled by the zktrie implement. Notice current the snapshot would be disabled by the zktrie implement.

View file

@ -17,15 +17,10 @@
package main package main
import ( import (
"encoding/json"
"fmt"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"testing" "testing"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/core"
) )
var customGenesisTests = []struct { 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 // Tests that initializing Geth with a custom genesis block and chain definitions
// work properly. // work properly.
func TestCustomGenesis(t *testing.T) { func TestCustomGenesis(t *testing.T) {
if err := addCustomGenesis(); err != nil {
t.Error(err)
}
for i, tt := range customGenesisTests { for i, tt := range customGenesisTests {
// Create a temporary data directory to use and inspect later // Create a temporary data directory to use and inspect later
datadir := tmpdir(t) datadir := tmpdir(t)

View file

@ -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
}

View file

@ -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
}