Skip to content

Commit

Permalink
Merge pull request #614 from etclabscore/fix-config-toml
Browse files Browse the repository at this point in the history
Fix config toml, go generate
  • Loading branch information
meowsbits authored Feb 5, 2024
2 parents e56a929 + 82ebc79 commit 10f96b3
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 125 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/go-generate-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Developer helper
on: pull_request
on:
pull_request:
workflow_dispatch:
env:
# GENERATE_EXCEPTIONS are exceptions made to the 'go generate' command.
# These patterns are matched (negatively) against 'go list' output.
Expand Down
5 changes: 2 additions & 3 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"errors"
"fmt"
"math"
"math/big"
"os"
"reflect"
"unicode"
Expand Down Expand Up @@ -171,7 +170,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
stack, cfg := makeConfigNode(ctx)
if ctx.IsSet(utils.ECBP1100Flag.Name) {
if n := ctx.Uint64(utils.ECBP1100Flag.Name); n != math.MaxUint64 {
cfg.Eth.ECBP1100 = new(big.Int).SetUint64(n)
cfg.Eth.OverrideECBP1100 = &n
}
}
if ctx.IsSet(utils.ECBP1100NoDisableFlag.Name) {
Expand All @@ -181,7 +180,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
}
if ctx.IsSet(utils.OverrideECBP1100DeactivateFlag.Name) {
if n := ctx.Uint64(utils.OverrideECBP1100DeactivateFlag.Name); n != math.MaxUint64 {
cfg.Eth.OverrideECBP1100Deactivate = new(big.Int).SetUint64(n)
cfg.Eth.OverrideECBP1100Deactivate = &n
}
}
if ctx.IsSet(utils.OverrideShanghai.Name) {
Expand Down
8 changes: 3 additions & 5 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,13 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
}
eth.bloomIndexer.Start(eth.blockchain)
// Handle artificial finality config override cases.
if n := config.ECBP1100; n != nil {
v := n.Uint64()
if err := eth.blockchain.Config().SetECBP1100Transition(&v); err != nil {
if n := config.OverrideECBP1100; n != nil {
if err := eth.blockchain.Config().SetECBP1100Transition(n); err != nil {
return nil, err
}
}
if n := config.OverrideECBP1100Deactivate; n != nil {
v := n.Uint64()
if err := eth.blockchain.Config().SetECBP1100DeactivateTransition(&v); err != nil {
if err := eth.blockchain.Config().SetECBP1100DeactivateTransition(n); err != nil {
return nil, err
}
}
Expand Down
5 changes: 2 additions & 3 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package ethconfig

import (
"math/big"
"os"
"os/user"
"path/filepath"
Expand Down Expand Up @@ -217,9 +216,9 @@ type Config struct {
CheckpointOracle *ctypes.CheckpointOracleConfig `toml:",omitempty"`

// Manual configuration field for ECBP1100 activation number. Used for modifying genesis config via CLI flag.
ECBP1100 *big.Int
OverrideECBP1100 *uint64 `toml:",omitempty"`
// Manual configuration field for ECBP1100's disablement block number. Used for modifying genesis config via CLI flag.
OverrideECBP1100Deactivate *big.Int
OverrideECBP1100Deactivate *uint64 `toml:",omitempty"`

// ECBP1100NoDisable overrides
// When this value is *true, ECBP100 will not (ever) be disabled; when *false, it will never be enabled.
Expand Down
218 changes: 108 additions & 110 deletions eth/ethconfig/gen_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions params/types/genesisT/gen_genesis.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 10f96b3

Please sign in to comment.