Closed meowsbits closed 5 months ago
The config also includes a field ECBP1100Disable
which should not be there, it should be OverrideECBP1100Deactivate
. Makes me wonder about the go generate
check too.
go generate -skip=trezor ./...
yields:
diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go
index fc71033021..8413f23c26 100644
--- a/eth/ethconfig/gen_config.go
+++ b/eth/ethconfig/gen_config.go
@@ -20,57 +20,57 @@ import (
// MarshalTOML marshals as TOML.
func (c Config) MarshalTOML() (interface{}, error) {
type Config struct {
- Genesis *genesisT.Genesis `toml:",omitempty"`
- NetworkId uint64
- ProtocolVersions []uint
- SyncMode downloader.SyncMode
- EthDiscoveryURLs []string
- SnapDiscoveryURLs []string
- NoPruning bool
- NoPrefetch bool
- TxLookupLimit uint64 `toml:",omitempty"`
- RequiredBlocks map[uint64]common.Hash `toml:"-"`
- LightServ int `toml:",omitempty"`
- LightIngress int `toml:",omitempty"`
- LightEgress int `toml:",omitempty"`
- LightPeers int `toml:",omitempty"`
- LightNoPrune bool `toml:",omitempty"`
- LightNoSyncServe bool `toml:",omitempty"`
- SyncFromCheckpoint bool `toml:",omitempty"`
- UltraLightServers []string `toml:",omitempty"`
- UltraLightFraction int `toml:",omitempty"`
- UltraLightOnlyAnnounce bool `toml:",omitempty"`
- SkipBcVersionCheck bool `toml:"-"`
- DatabaseHandles int `toml:"-"`
- DatabaseCache int
- DatabaseFreezer string
- DatabaseFreezerRemote string
- TrieCleanCache int
- TrieDirtyCache int
- TrieTimeout time.Duration
- SnapshotCache int
- Preimages bool
- FilterLogCacheSize int
- Miner miner.Config
- Ethash ethash.Config
- TxPool legacypool.Config
- BlobPool blobpool.Config
- GPO gasprice.Config
- EnablePreimageRecording bool
- DocRoot string `toml:"-"`
- EWASMInterpreter string
- EVMInterpreter string
- RPCGasCap uint64
- RPCEVMTimeout time.Duration
- RPCTxFeeCap float64
- Checkpoint *ctypes.TrustedCheckpoint `toml:",omitempty"`
- CheckpointOracle *ctypes.CheckpointOracleConfig `toml:",omitempty"`
- ECBP1100 *big.Int
- ECBP1100Disable *big.Int
- ECBP1100NoDisable *bool `toml:",omitempty"`
- OverrideShanghai *uint64 `toml:",omitempty"`
- OverrideCancun *uint64 `toml:",omitempty"`
- OverrideVerkle *uint64 `toml:",omitempty"`
+ Genesis *genesisT.Genesis `toml:",omitempty"`
+ NetworkId uint64
+ ProtocolVersions []uint
+ SyncMode downloader.SyncMode
+ EthDiscoveryURLs []string
+ SnapDiscoveryURLs []string
+ NoPruning bool
+ NoPrefetch bool
+ TxLookupLimit uint64 `toml:",omitempty"`
+ RequiredBlocks map[uint64]common.Hash `toml:"-"`
+ LightServ int `toml:",omitempty"`
+ LightIngress int `toml:",omitempty"`
+ LightEgress int `toml:",omitempty"`
+ LightPeers int `toml:",omitempty"`
+ LightNoPrune bool `toml:",omitempty"`
+ LightNoSyncServe bool `toml:",omitempty"`
+ SyncFromCheckpoint bool `toml:",omitempty"`
+ UltraLightServers []string `toml:",omitempty"`
+ UltraLightFraction int `toml:",omitempty"`
+ UltraLightOnlyAnnounce bool `toml:",omitempty"`
+ SkipBcVersionCheck bool `toml:"-"`
+ DatabaseHandles int `toml:"-"`
+ DatabaseCache int
+ DatabaseFreezer string
+ DatabaseFreezerRemote string
+ TrieCleanCache int
+ TrieDirtyCache int
+ TrieTimeout time.Duration
+ SnapshotCache int
+ Preimages bool
+ FilterLogCacheSize int
+ Miner miner.Config
+ Ethash ethash.Config
+ TxPool legacypool.Config
+ BlobPool blobpool.Config
+ GPO gasprice.Config
+ EnablePreimageRecording bool
+ DocRoot string `toml:"-"`
+ EWASMInterpreter string
+ EVMInterpreter string
+ RPCGasCap uint64
+ RPCEVMTimeout time.Duration
+ RPCTxFeeCap float64
+ Checkpoint *ctypes.TrustedCheckpoint `toml:",omitempty"`
+ CheckpointOracle *ctypes.CheckpointOracleConfig `toml:",omitempty"`
+ ECBP1100 *big.Int
+ OverrideECBP1100Deactivate *big.Int
+ ECBP1100NoDisable *bool `toml:",omitempty"`
+ OverrideShanghai *uint64 `toml:",omitempty"`
+ OverrideCancun *uint64 `toml:",omitempty"`
+ OverrideVerkle *uint64 `toml:",omitempty"`
}
var enc Config
enc.Genesis = c.Genesis
@@ -119,9 +119,8 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.Checkpoint = c.Checkpoint
enc.CheckpointOracle = c.CheckpointOracle
enc.ECBP1100 = c.ECBP1100
- enc.ECBP1100Disable = c.OverrideECBP1100Deactivate
+ enc.OverrideECBP1100Deactivate = c.OverrideECBP1100Deactivate
enc.ECBP1100NoDisable = c.ECBP1100NoDisable
-
enc.OverrideShanghai = c.OverrideShanghai
enc.OverrideCancun = c.OverrideCancun
enc.OverrideVerkle = c.OverrideVerkle
@@ -131,57 +130,57 @@ func (c Config) MarshalTOML() (interface{}, error) {
// UnmarshalTOML unmarshals from TOML.
func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
type Config struct {
- Genesis *genesisT.Genesis `toml:",omitempty"`
- NetworkId *uint64
- ProtocolVersions []uint
- SyncMode *downloader.SyncMode
- EthDiscoveryURLs []string
- SnapDiscoveryURLs []string
- NoPruning *bool
- NoPrefetch *bool
- TxLookupLimit *uint64 `toml:",omitempty"`
- RequiredBlocks map[uint64]common.Hash `toml:"-"`
- LightServ *int `toml:",omitempty"`
- LightIngress *int `toml:",omitempty"`
- LightEgress *int `toml:",omitempty"`
- LightPeers *int `toml:",omitempty"`
- LightNoPrune *bool `toml:",omitempty"`
- LightNoSyncServe *bool `toml:",omitempty"`
- SyncFromCheckpoint *bool `toml:",omitempty"`
- UltraLightServers []string `toml:",omitempty"`
- UltraLightFraction *int `toml:",omitempty"`
- UltraLightOnlyAnnounce *bool `toml:",omitempty"`
- SkipBcVersionCheck *bool `toml:"-"`
- DatabaseHandles *int `toml:"-"`
- DatabaseCache *int
- DatabaseFreezer *string
- DatabaseFreezerRemote *string
- TrieCleanCache *int
- TrieDirtyCache *int
- TrieTimeout *time.Duration
- SnapshotCache *int
- Preimages *bool
- FilterLogCacheSize *int
- Miner *miner.Config
- Ethash *ethash.Config
- TxPool *legacypool.Config
- BlobPool *blobpool.Config
- GPO *gasprice.Config
- EnablePreimageRecording *bool
- DocRoot *string `toml:"-"`
- EWASMInterpreter *string
- EVMInterpreter *string
- RPCGasCap *uint64
- RPCEVMTimeout *time.Duration
- RPCTxFeeCap *float64
- Checkpoint *ctypes.TrustedCheckpoint `toml:",omitempty"`
- CheckpointOracle *ctypes.CheckpointOracleConfig `toml:",omitempty"`
- ECBP1100 *big.Int
- ECBP1100Disable *big.Int
- ECBP1100NoDisable *bool `toml:",omitempty"`
- OverrideShanghai *uint64 `toml:",omitempty"`
- OverrideCancun *uint64 `toml:",omitempty"`
- OverrideVerkle *uint64 `toml:",omitempty"`
+ Genesis *genesisT.Genesis `toml:",omitempty"`
+ NetworkId *uint64
+ ProtocolVersions []uint
+ SyncMode *downloader.SyncMode
+ EthDiscoveryURLs []string
+ SnapDiscoveryURLs []string
+ NoPruning *bool
+ NoPrefetch *bool
+ TxLookupLimit *uint64 `toml:",omitempty"`
+ RequiredBlocks map[uint64]common.Hash `toml:"-"`
+ LightServ *int `toml:",omitempty"`
+ LightIngress *int `toml:",omitempty"`
+ LightEgress *int `toml:",omitempty"`
+ LightPeers *int `toml:",omitempty"`
+ LightNoPrune *bool `toml:",omitempty"`
+ LightNoSyncServe *bool `toml:",omitempty"`
+ SyncFromCheckpoint *bool `toml:",omitempty"`
+ UltraLightServers []string `toml:",omitempty"`
+ UltraLightFraction *int `toml:",omitempty"`
+ UltraLightOnlyAnnounce *bool `toml:",omitempty"`
+ SkipBcVersionCheck *bool `toml:"-"`
+ DatabaseHandles *int `toml:"-"`
+ DatabaseCache *int
+ DatabaseFreezer *string
+ DatabaseFreezerRemote *string
+ TrieCleanCache *int
+ TrieDirtyCache *int
+ TrieTimeout *time.Duration
+ SnapshotCache *int
+ Preimages *bool
+ FilterLogCacheSize *int
+ Miner *miner.Config
+ Ethash *ethash.Config
+ TxPool *legacypool.Config
+ BlobPool *blobpool.Config
+ GPO *gasprice.Config
+ EnablePreimageRecording *bool
+ DocRoot *string `toml:"-"`
+ EWASMInterpreter *string
+ EVMInterpreter *string
+ RPCGasCap *uint64
+ RPCEVMTimeout *time.Duration
+ RPCTxFeeCap *float64
+ Checkpoint *ctypes.TrustedCheckpoint `toml:",omitempty"`
+ CheckpointOracle *ctypes.CheckpointOracleConfig `toml:",omitempty"`
+ ECBP1100 *big.Int
+ OverrideECBP1100Deactivate *big.Int
+ ECBP1100NoDisable *bool `toml:",omitempty"`
+ OverrideShanghai *uint64 `toml:",omitempty"`
+ OverrideCancun *uint64 `toml:",omitempty"`
+ OverrideVerkle *uint64 `toml:",omitempty"`
}
var dec Config
if err := unmarshal(&dec); err != nil {
@@ -325,8 +324,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if dec.ECBP1100 != nil {
c.ECBP1100 = dec.ECBP1100
}
- if dec.ECBP1100Disable != nil {
- c.OverrideECBP1100Deactivate = dec.ECBP1100Disable
+ if dec.OverrideECBP1100Deactivate != nil {
+ c.OverrideECBP1100Deactivate = dec.OverrideECBP1100Deactivate
}
if dec.ECBP1100NoDisable != nil {
c.ECBP1100NoDisable = dec.ECBP1100NoDisable
diff --git a/params/types/genesisT/gen_genesis.go b/params/types/genesisT/gen_genesis.go
index 12f3d10b05..6438ab5125 100644
--- a/params/types/genesisT/gen_genesis.go
+++ b/params/types/genesisT/gen_genesis.go
@@ -10,10 +10,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
- "github.com/ethereum/go-ethereum/params/confp/generic"
- "github.com/ethereum/go-ethereum/params/types/coregeth"
"github.com/ethereum/go-ethereum/params/types/ctypes"
- "github.com/ethereum/go-ethereum/params/types/goethereum"
)
var _ = (*genesisSpecMarshaling)(nil)
@@ -76,27 +73,11 @@ func (g *Genesis) UnmarshalJSON(input []byte) error {
Number *math.HexOrDecimal64 `json:"number"`
GasUsed *math.HexOrDecimal64 `json:"gasUsed"`
ParentHash *common.Hash `json:"parentHash"`
- BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas"`
- ExcessBlobGas *math.HexOrDecimal64 `json:"excessBlobGas"`
- BlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed"`
+ BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas,omitempty"`
+ ExcessBlobGas *math.HexOrDecimal64 `json:"excessBlobGas,omitempty"`
+ BlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed,omitempty"`
}
var dec Genesis
- // We have to look at the raw input, decide what kind of configurator schema it's using,
- // then assign the decoder struct to use that schema type.
- conf, err := generic.UnmarshalChainConfigurator(input)
- if err != nil {
- return err
- }
-
- switch conf.(type) {
- case *coregeth.CoreGethChainConfig:
- dec.Config = &coregeth.CoreGethChainConfig{}
- case *goethereum.ChainConfig:
- dec.Config = &goethereum.ChainConfig{}
- default:
- panic("unmarshal genesis chain config returned a type not supported by unmarshaling")
- }
-
if err := json.Unmarshal(input, &dec); err != nil {
return err
}