mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
cmd/evm: wire up t8n with EELS binary fork (#575)
This commit is contained in:
parent
e32a3e24b9
commit
da402f4b06
2 changed files with 42 additions and 2 deletions
|
|
@ -393,8 +393,20 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
|
|||
return statedb, execRs, body, nil
|
||||
}
|
||||
|
||||
// newPrestateTrieDBConfig returns the triedb config used to construct the
|
||||
// prestate. UBT mode requires the path-based backend; the legacy hash-based
|
||||
// backend cannot decode UBT-encoded nodes.
|
||||
func newPrestateTrieDBConfig(isBintrie bool) *triedb.Config {
|
||||
if isBintrie {
|
||||
cfg := *triedb.UBTDefaults
|
||||
cfg.Preimages = true
|
||||
return &cfg
|
||||
}
|
||||
return &triedb.Config{Preimages: true}
|
||||
}
|
||||
|
||||
func MakePreState(db ethdb.Database, accounts types.GenesisAlloc, isBintrie bool) *state.StateDB {
|
||||
tdb := triedb.NewDatabase(db, &triedb.Config{Preimages: true, IsUBT: isBintrie})
|
||||
tdb := triedb.NewDatabase(db, newPrestateTrieDBConfig(isBintrie))
|
||||
sdb := state.NewDatabase(tdb, nil)
|
||||
if isBintrie {
|
||||
sdb.(*state.UBTDatabase).EnableAllocRecording()
|
||||
|
|
@ -436,7 +448,7 @@ func MakePreState(db ethdb.Database, accounts types.GenesisAlloc, isBintrie bool
|
|||
// MakePreStateStreaming is like MakePreState, but decodes the alloc from disk
|
||||
// one account at a time so the full map is never held in memory.
|
||||
func MakePreStateStreaming(db ethdb.Database, allocPath string, isBintrie bool) (*state.StateDB, error) {
|
||||
tdb := triedb.NewDatabase(db, &triedb.Config{Preimages: true, IsUBT: isBintrie})
|
||||
tdb := triedb.NewDatabase(db, newPrestateTrieDBConfig(isBintrie))
|
||||
sdb := state.NewDatabase(tdb, nil)
|
||||
if isBintrie {
|
||||
sdb.(*state.UBTDatabase).EnableAllocRecording()
|
||||
|
|
|
|||
|
|
@ -776,6 +776,34 @@ var Forks = map[string]*params.ChainConfig{
|
|||
ShanghaiTime: u64(0),
|
||||
UBTTime: u64(0),
|
||||
},
|
||||
"Binary": {
|
||||
ChainID: big.NewInt(1),
|
||||
HomesteadBlock: big.NewInt(0),
|
||||
EIP150Block: big.NewInt(0),
|
||||
EIP155Block: big.NewInt(0),
|
||||
EIP158Block: big.NewInt(0),
|
||||
ByzantiumBlock: big.NewInt(0),
|
||||
ConstantinopleBlock: big.NewInt(0),
|
||||
PetersburgBlock: big.NewInt(0),
|
||||
IstanbulBlock: big.NewInt(0),
|
||||
MuirGlacierBlock: big.NewInt(0),
|
||||
BerlinBlock: big.NewInt(0),
|
||||
LondonBlock: big.NewInt(0),
|
||||
ArrowGlacierBlock: big.NewInt(0),
|
||||
MergeNetsplitBlock: big.NewInt(0),
|
||||
TerminalTotalDifficulty: big.NewInt(0),
|
||||
ShanghaiTime: u64(0),
|
||||
CancunTime: u64(0),
|
||||
PragueTime: u64(0),
|
||||
OsakaTime: u64(0),
|
||||
UBTTime: u64(0),
|
||||
DepositContractAddress: params.MainnetChainConfig.DepositContractAddress,
|
||||
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||
Cancun: params.DefaultCancunBlobConfig,
|
||||
Prague: params.DefaultPragueBlobConfig,
|
||||
Osaka: params.DefaultOsakaBlobConfig,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
var bpo1BlobConfig = ¶ms.BlobConfig{
|
||||
|
|
|
|||
Loading…
Reference in a new issue