Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate --interop-genesis-state #12008

Merged
merged 35 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d9e48cd
Deprecaste `--interop-genesis-state`
rkapka Feb 17, 2023
1426cf3
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 17, 2023
ca1c85d
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 17, 2023
87379f4
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 17, 2023
24a98a3
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 18, 2023
75b1bf7
better pattern
rkapka Feb 22, 2023
70af40f
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 22, 2023
10ebc7e
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 22, 2023
3541026
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 22, 2023
0307b72
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 23, 2023
e8e4e23
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 23, 2023
7f18028
fix errors
rkapka Feb 23, 2023
ff2c324
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 23, 2023
b0d7bf9
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 23, 2023
79d50f1
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 23, 2023
bb6d711
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 23, 2023
c41cb7e
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 23, 2023
acb9892
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 24, 2023
66a5be0
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 24, 2023
fe0a054
test fix
rkapka Feb 24, 2023
1b11b72
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 24, 2023
ee9bdc5
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 24, 2023
9f5dfdd
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 24, 2023
5ec48dd
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 25, 2023
f546cef
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 27, 2023
8a3de1d
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 27, 2023
aa8e8b7
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 27, 2023
635f212
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 28, 2023
2069dec
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 28, 2023
8985e5f
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 28, 2023
7ed8979
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 28, 2023
0723e36
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Feb 28, 2023
8b659cc
Merge branch '__develop' into deprecate-interop-flag
rkapka Mar 1, 2023
4828dd5
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Mar 1, 2023
3d3b2d5
Merge refs/heads/develop into deprecate-interop-flag
prylabs-bulldozer[bot] Mar 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions beacon-chain/node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,11 @@ func configureInteropConfig(cliCtx *cli.Context) error {
if cliCtx.IsSet(cmd.ChainConfigFileFlag.Name) {
return nil
}
genStateIsSet := cliCtx.IsSet(flags.InteropGenesisStateFlag.Name)
genTimeIsSet := cliCtx.IsSet(flags.InteropGenesisTimeFlag.Name)
numValsIsSet := cliCtx.IsSet(flags.InteropNumValidatorsFlag.Name)
votesIsSet := cliCtx.IsSet(flags.InteropMockEth1DataVotesFlag.Name)

if genStateIsSet || genTimeIsSet || numValsIsSet || votesIsSet {
if genTimeIsSet || numValsIsSet || votesIsSet {
if err := params.SetActive(params.InteropConfig().Copy()); err != nil {
return err
}
Expand Down
11 changes: 0 additions & 11 deletions beacon-chain/node/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,6 @@ func TestConfigureInterop(t *testing.T) {
},
"interop",
},
{
"genesis state set",
func() *cli.Context {
app := cli.App{}
set := flag.NewFlagSet("test", 0)
set.String(flags.InteropGenesisStateFlag.Name, "", "")
assert.NoError(t, set.Set(flags.InteropGenesisStateFlag.Name, "/path/"))
return cli.NewContext(&app, set, nil)
},
"interop",
},
}

for _, tt := range tests {
Expand Down
7 changes: 2 additions & 5 deletions beacon-chain/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,9 @@ func (b *BeaconNode) registerRPCService() error {
}

genesisValidators := b.cliCtx.Uint64(flags.InteropNumValidatorsFlag.Name)
genesisStatePath := b.cliCtx.String(flags.InteropGenesisStateFlag.Name)
var depositFetcher depositcache.DepositFetcher
var chainStartFetcher execution.ChainStartFetcher
if genesisValidators > 0 || genesisStatePath != "" {
if genesisValidators > 0 {
var interopService *interopcoldstart.Service
if err := b.services.FetchService(&interopService); err != nil {
return err
Expand Down Expand Up @@ -917,15 +916,13 @@ func (b *BeaconNode) registerGRPCGateway() error {
func (b *BeaconNode) registerDeterminsticGenesisService() error {
genesisTime := b.cliCtx.Uint64(flags.InteropGenesisTimeFlag.Name)
genesisValidators := b.cliCtx.Uint64(flags.InteropNumValidatorsFlag.Name)
genesisStatePath := b.cliCtx.String(flags.InteropGenesisStateFlag.Name)

if genesisValidators > 0 || genesisStatePath != "" {
if genesisValidators > 0 {
svc := interopcoldstart.NewService(b.ctx, &interopcoldstart.Config{
GenesisTime: genesisTime,
NumValidators: genesisValidators,
BeaconDB: b.db,
DepositCache: b.depositCache,
GenesisPath: genesisStatePath,
})
svc.Start()

Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func TestNodeStart_Ok_registerDeterministicGenesisService(t *testing.T) {
genesisBytes, err := genesisState.MarshalSSZ()
require.NoError(t, err)
require.NoError(t, os.WriteFile("genesis_ssz.json", genesisBytes, 0666))
set.String(flags.InteropGenesisStateFlag.Name, "genesis_ssz.json", "")
set.String("genesis-state", "genesis_ssz.json", "")
ctx := cli.NewContext(&app, set, nil)
node, err := New(ctx, WithBlockchainFlagOptions([]blockchain.Option{}),
WithBuilderFlagOptions([]builder.Option{}),
Expand Down
7 changes: 0 additions & 7 deletions cmd/beacon-chain/flags/interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ import (
)

var (
// InteropGenesisStateFlag defines a flag for the beacon node to load genesis state via file.
InteropGenesisStateFlag = &cli.StringFlag{
Name: "interop-genesis-state",
Usage: "The genesis state file (.SSZ) to load from. Note: loading from an interop genesis " +
"state does not use a web3 connection to read any deposits. This interop " +
"functionality should not be used with public testnets.",
}
// InteropMockEth1DataVotesFlag enables mocking the eth1 proof-of-work chain data put into blocks by proposers.
InteropMockEth1DataVotesFlag = &cli.BoolFlag{
Name: "interop-eth1data-votes",
Expand Down
1 change: 0 additions & 1 deletion cmd/beacon-chain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ var appFlags = []cli.Flag{
flags.BlockBatchLimit,
flags.BlockBatchLimitBurstFactor,
flags.InteropMockEth1DataVotesFlag,
flags.InteropGenesisStateFlag,
flags.InteropNumValidatorsFlag,
flags.InteropGenesisTimeFlag,
flags.SlotsPerArchivedPoint,
Expand Down
3 changes: 1 addition & 2 deletions cmd/beacon-chain/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ var appHelpFlagGroups = []flagGroup{
Name: "beacon-chain",
Flags: []cli.Flag{
flags.InteropMockEth1DataVotesFlag,
flags.InteropGenesisStateFlag,
flags.DepositContractFlag,
flags.ContractDeploymentBlock,
flags.RPCHost,
Expand Down Expand Up @@ -173,7 +172,7 @@ var appHelpFlagGroups = []flagGroup{
{
Name: "interop",
Flags: []cli.Flag{
flags.InteropGenesisStateFlag,
genesis.StatePath,
flags.InteropGenesisTimeFlag,
flags.InteropNumValidatorsFlag,
},
Expand Down
6 changes: 6 additions & 0 deletions config/features/deprecated_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ var (
Usage: deprecatedUsage,
Hidden: true,
}
deprecatedInteropGenesisState = &cli.StringFlag{
Name: "interop-genesis-state",
Usage: deprecatedUsage,
Hidden: true,
}
)

// Deprecated flags for both the beacon node and validator client.
Expand All @@ -111,6 +116,7 @@ var deprecatedFlags = []cli.Flag{
deprecatedEnableDefensivePull,
deprecatedDisableNativeState,
deprecatedRopstenTestnet,
deprecatedInteropGenesisState,
}

// deprecatedBeaconFlags contains flags that are still used by other components
Expand Down