Skip to content

Commit

Permalink
e2e: expedited proposal test (#2341)
Browse files Browse the repository at this point in the history
* e2e test expedited proposals

* update go mod comment

* address romans comments from sdk fork PR

* Update tests/e2e/configurer/chain/commands.go

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>

* address Roman review

* update go sum

* implement Roman's suggestion

* Update tests/e2e/e2e_test.go

Co-authored-by: Roman <roman@osmosis.team>

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Roman <roman@osmosis.team>
  • Loading branch information
3 people authored Aug 13, 2022
1 parent 2530987 commit e41d3e7
Show file tree
Hide file tree
Showing 16 changed files with 138 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ test-sim-app:
test-sim-determinism:
@VERSION=$(VERSION) go test -mod=readonly -run ^TestAppStateDeterminism -v $(PACKAGES_SIM)

test-sim-benchmark:
test-sim-bench:
@VERSION=$(VERSION) go test -benchmem -run ^BenchmarkFullAppSimulation -bench ^BenchmarkFullAppSimulation -cpuprofile cpu.out $(PACKAGES_SIM)

test-e2e:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ require (
replace (
// branch: v0.27.0.rc3-osmo, current tag: v0.27.0.rc3-osmo
github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58
// Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current tag: 0.45.0x-osmo-v11-alpha.5 current branch: osmosis-main
github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220727221653-51bfa90799ee
// Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk, current tag: 0.45.0x-osmo-v12-alpha.1 current branch: osmosis-main
github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220808173601-02273b880e44
// Use Osmosis fast iavl
github.com/cosmos/iavl => github.com/osmosis-labs/iavl v0.17.3-osmo-v7
// use cosmos-compatible protobufs
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1104,8 +1104,8 @@ github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4
github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs=
github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY=
github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM=
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220727221653-51bfa90799ee h1:JUWaacaNfxC0IxxkpC/MsJozi1eKQztZX+Wa9OU6+cw=
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220727221653-51bfa90799ee/go.mod h1:uUkGXyCWol+CHoaMxZA0nKglvlN5uHBCMbMSsZoGSAs=
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220808173601-02273b880e44 h1:mjsR4jDM16FYVkh5ZQv6IRcPheU3yG60t1KetG8FEPU=
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220808173601-02273b880e44/go.mod h1:uUkGXyCWol+CHoaMxZA0nKglvlN5uHBCMbMSsZoGSAs=
github.com/osmosis-labs/go-mutesting v0.0.0-20220811235203-65a53b4ea8e3 h1:/imbKy8s1I+z7wx4FbRHOXK2v82xesUCz2EPUqfBDIg=
github.com/osmosis-labs/go-mutesting v0.0.0-20220811235203-65a53b4ea8e3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI=
github.com/osmosis-labs/iavl v0.17.3-osmo-v7 h1:6KcADC/WhL7yDmNQxUIJt2XmzNt4FfRmq9gRke45w74=
Expand Down
14 changes: 10 additions & 4 deletions tests/e2e/configurer/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/stretchr/testify/require"
coretypes "github.com/tendermint/tendermint/rpc/core/types"

"github.com/osmosis-labs/osmosis/v11/tests/e2e/configurer/config"

"github.com/osmosis-labs/osmosis/v11/tests/e2e/containers"
"github.com/osmosis-labs/osmosis/v11/tests/e2e/initialization"
)
Expand All @@ -18,7 +20,8 @@ type Config struct {

ValidatorInitConfigs []*initialization.NodeConfig
// voting period is number of blocks it takes to deposit, 1.2 seconds per validator to vote on the prop, and a buffer.
VotingPeriod float32
VotingPeriod float32
ExpeditedVotingPeriod float32
// upgrade proposal height for chain.
UpgradePropHeight int64
LatestProposalNumber int
Expand All @@ -40,13 +43,16 @@ const (
)

func New(t *testing.T, containerManager *containers.Manager, id string, initValidatorConfigs []*initialization.NodeConfig) *Config {
numVal := float32(len(initValidatorConfigs))
return &Config{
ChainMeta: initialization.ChainMeta{
Id: id,
},
ValidatorInitConfigs: initValidatorConfigs,
t: t,
containerManager: containerManager,
ValidatorInitConfigs: initValidatorConfigs,
VotingPeriod: config.PropDepositBlocks + numVal*config.PropVoteBlocks + config.PropBufferBlocks,
ExpeditedVotingPeriod: config.PropDepositBlocks + numVal*config.PropVoteBlocks + config.PropBufferBlocks - 1,
t: t,
containerManager: containerManager,
}
}

Expand Down
34 changes: 31 additions & 3 deletions tests/e2e/configurer/chain/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"regexp"
"strconv"
"strings"
"time"

appparams "github.com/osmosis-labs/osmosis/v11/app/params"
"github.com/osmosis-labs/osmosis/v11/tests/e2e/configurer/config"
Expand Down Expand Up @@ -37,17 +38,24 @@ func (n *NodeConfig) SubmitSuperfluidProposal(asset string, initialDeposit sdk.C
n.LogActionF("successfully submitted superfluid proposal for asset %s", asset)
}

func (n *NodeConfig) SubmitTextProposal(text string, initialDeposit sdk.Coin) {
func (n *NodeConfig) SubmitTextProposal(text string, initialDeposit sdk.Coin, isExpedited bool) {
n.LogActionF("submitting text gov proposal")
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "--type=text", fmt.Sprintf("--title=\"%s\"", text), "--description=\"test text proposal\"", "--from=val", fmt.Sprintf("--deposit=%s", initialDeposit)}
if isExpedited {
cmd = append(cmd, "--is-expedited=true")
}
_, _, err := n.containerManager.ExecTxCmd(n.t, n.chainId, n.Name, cmd)
require.NoError(n.t, err)
n.LogActionF("successfully submitted text gov proposal")
}

func (n *NodeConfig) DepositProposal(proposalNumber int) {
func (n *NodeConfig) DepositProposal(proposalNumber int, isExpedited bool) {
n.LogActionF("depositing on proposal: %d", proposalNumber)
cmd := []string{"osmosisd", "tx", "gov", "deposit", fmt.Sprintf("%d", proposalNumber), sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(config.MinDepositValue)).String(), "--from=val"}
deposit := sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(config.MinDepositValue)).String()
if isExpedited {
deposit = sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(config.MinExpeditedDepositValue)).String()
}
cmd := []string{"osmosisd", "tx", "gov", "deposit", fmt.Sprintf("%d", proposalNumber), deposit, "--from=val"}
_, _, err := n.containerManager.ExecTxCmd(n.t, n.chainId, n.Name, cmd)
require.NoError(n.t, err)
n.LogActionF("successfully deposited on proposal %d", proposalNumber)
Expand Down Expand Up @@ -105,3 +113,23 @@ func (n *NodeConfig) CreateWallet(walletName string) string {
n.LogActionF("created wallet %s, waller address - %s", walletName, walletAddr)
return walletAddr
}

func (n *NodeConfig) QueryPropStatusTimed(proposalNumber int, desiredStatus string, totalTime chan time.Duration) {
start := time.Now()
require.Eventually(
n.t,
func() bool {
status, err := n.QueryPropStatus(proposalNumber)
if err != nil {
return false
}

return status == desiredStatus
},
1*time.Minute,
10*time.Millisecond,
"Osmosis node failed to retrieve prop tally",
)
elapsed := time.Since(start)
totalTime <- elapsed
}
14 changes: 14 additions & 0 deletions tests/e2e/configurer/chain/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ func (n *NodeConfig) QueryPropTally(proposalNumber int) (sdk.Int, sdk.Int, sdk.I
return noTotal, yesTotal, noWithVetoTotal, abstainTotal, nil
}

func (n *NodeConfig) QueryPropStatus(proposalNumber int) (string, error) {
path := fmt.Sprintf("cosmos/gov/v1beta1/proposals/%d", proposalNumber)
bz, err := n.QueryGRPCGateway(path)
require.NoError(n.t, err)

var propResp govtypes.QueryProposalResponse
if err := util.Cdc.UnmarshalJSON(bz, &propResp); err != nil {
return "", err
}
proposalStatus := propResp.Proposal.Status

return proposalStatus.String(), nil
}

func (n *NodeConfig) QueryIntermediaryAccount(denom string, valAddr string) (int, error) {
intAccount := superfluidtypes.GetSuperfluidIntermediaryAccountAddr(denom, valAddr)
path := fmt.Sprintf(
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/configurer/config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const (
var (
// Minimum deposit value for a proposal to enter a voting period.
MinDepositValue = govtypes.DefaultMinDepositTokens.Int64()
// Minimum expedited deposit value for a proposal to enter a voting period.
MinExpeditedDepositValue = govtypes.DefaultMinExpeditedDepositTokens.Int64()
// Minimum deposit value for proposal to be submitted.
InitialMinDeposit = MinDepositValue / 4
// Minimum expedited deposit value for proposal to be submitted.
InitialMinExpeditedDeposit = MinExpeditedDepositValue / 4
)
3 changes: 2 additions & 1 deletion tests/e2e/configurer/current.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func (cb *CurrentBranchConfigurer) ConfigureChain(chainConfig *chain.Config) err
return err
}
cb.t.Logf("temp directory for chain-id %v: %v", chainConfig.Id, tmpDir)
initializedChain, err := initialization.InitChain(chainConfig.Id, tmpDir, chainConfig.ValidatorInitConfigs, time.Duration(chainConfig.VotingPeriod), 0)

initializedChain, err := initialization.InitChain(chainConfig.Id, tmpDir, chainConfig.ValidatorInitConfigs, time.Duration(chainConfig.VotingPeriod*1000000000), time.Duration(chainConfig.ExpeditedVotingPeriod*1000000000), 0)
if err != nil {
return err
}
Expand Down
7 changes: 2 additions & 5 deletions tests/e2e/configurer/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ func (uc *UpgradeConfigurer) ConfigureChain(chainConfig *chain.Config) error {
return err
}

numVal := float32(len(chainConfig.ValidatorInitConfigs))
chainConfig.VotingPeriod = config.PropDepositBlocks + numVal*config.PropVoteBlocks + config.PropBufferBlocks

validatorConfigBytes, err := json.Marshal(chainConfig.ValidatorInitConfigs)
if err != nil {
return err
Expand All @@ -73,7 +70,7 @@ func (uc *UpgradeConfigurer) ConfigureChain(chainConfig *chain.Config) error {
forkHeight = forkHeight - config.ForkHeightPreUpgradeOffset
}

chainInitResource, err := uc.containerManager.RunChainInitResource(chainConfig.Id, int(chainConfig.VotingPeriod), validatorConfigBytes, tmpDir, int(forkHeight))
chainInitResource, err := uc.containerManager.RunChainInitResource(chainConfig.Id, int(chainConfig.VotingPeriod), int(chainConfig.ExpeditedVotingPeriod), validatorConfigBytes, tmpDir, int(forkHeight))
if err != nil {
return err
}
Expand Down Expand Up @@ -154,7 +151,7 @@ func (uc *UpgradeConfigurer) runProposalUpgrade() error {
chainConfig.UpgradePropHeight = currentHeight + int64(chainConfig.VotingPeriod) + int64(config.PropSubmitBlocks) + int64(config.PropBufferBlocks)
node.SubmitUpgradeProposal(uc.upgradeVersion, chainConfig.UpgradePropHeight, sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(config.InitialMinDeposit)))
chainConfig.LatestProposalNumber += 1
node.DepositProposal(chainConfig.LatestProposalNumber)
node.DepositProposal(chainConfig.LatestProposalNumber, false)
}
node.VoteYesProposal(initialization.ValidatorWalletName, chainConfig.LatestProposalNumber)
}
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/containers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ func (m *Manager) RunNodeResource(chainId string, containerName, valCondifDir st
// The genesis and configs are to be mounted on the init container as volume on mountDir path.
// Returns the container resource and error if any. This method does not Purge the container. The caller
// must deal with removing the resource.
func (m *Manager) RunChainInitResource(chainId string, chainVotingPeriod int, validatorConfigBytes []byte, mountDir string, forkHeight int) (*dockertest.Resource, error) {
func (m *Manager) RunChainInitResource(chainId string, chainVotingPeriod, chainExpeditedVotingPeriod int, validatorConfigBytes []byte, mountDir string, forkHeight int) (*dockertest.Resource, error) {
votingPeriodDuration := time.Duration(chainVotingPeriod * 1000000000)
// TODO: Uncomment this after v12 release
//expeditedVotingPeriodDuration := time.Duration(chainExpeditedVotingPeriod * 1000000000)

initResource, err := m.pool.RunWithOptions(
&dockertest.RunOptions{
Expand All @@ -243,6 +245,8 @@ func (m *Manager) RunChainInitResource(chainId string, chainVotingPeriod int, va
fmt.Sprintf("--chain-id=%s", chainId),
fmt.Sprintf("--config=%s", validatorConfigBytes),
fmt.Sprintf("--voting-period=%v", votingPeriodDuration),
// TODO: Uncomment this after v12 release
//fmt.Sprintf("--expedited-voting-period=%v", expeditedVotingPeriodDuration),
fmt.Sprintf("--fork-height=%v", forkHeight),
},
User: "root:root",
Expand Down
43 changes: 40 additions & 3 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (s *IntegrationTestSuite) TestSuperfluidVoting() {
// enable superfluid via proposal.
node.SubmitSuperfluidProposal("gamm/pool/1", sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(config.InitialMinDeposit)))
chain.LatestProposalNumber += 1
node.DepositProposal(chain.LatestProposalNumber)
node.DepositProposal(chain.LatestProposalNumber, false)
for _, node := range chain.NodeConfigs {
node.VoteYesProposal(initialization.ValidatorWalletName, chain.LatestProposalNumber)
}
Expand All @@ -73,9 +73,9 @@ func (s *IntegrationTestSuite) TestSuperfluidVoting() {
node.SuperfluidDelegate(chain.LatestLockNumber, chain.NodeConfigs[1].OperatorAddress, walletName)

// create a text prop, deposit and vote yes
node.SubmitTextProposal("superfluid vote overwrite test", sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(config.InitialMinDeposit)))
node.SubmitTextProposal("superfluid vote overwrite test", sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(config.InitialMinDeposit)), false)
chain.LatestProposalNumber += 1
node.DepositProposal(chain.LatestProposalNumber)
node.DepositProposal(chain.LatestProposalNumber, false)
for _, node := range chain.NodeConfigs {
node.VoteYesProposal(initialization.ValidatorWalletName, chain.LatestProposalNumber)
}
Expand Down Expand Up @@ -161,6 +161,7 @@ func (s *IntegrationTestSuite) TestStateSync() {
filepath.Join(runningNode.ConfigDir, "config", "genesis.json"),
stateSynchingNodeConfig,
time.Duration(chain.VotingPeriod),
//time.Duration(chain.ExpeditedVotingPeriod),
trustHeight,
trustHash,
stateSyncRPCServers,
Expand Down Expand Up @@ -214,3 +215,39 @@ func (s *IntegrationTestSuite) TestStateSync() {
err = chain.RemoveNode(stateSynchingNode.Name)
s.NoError(err)
}

func (s *IntegrationTestSuite) TestExpeditedProposals() {
if !s.skipUpgrade {
s.T().Skip("this can be re-enabled post v12")
}

chain := s.configurer.GetChainConfig(0)
node, err := chain.GetDefaultNode()
s.NoError(err)

node.SubmitTextProposal("expedited text proposal", sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(config.InitialMinExpeditedDeposit)), true)
chain.LatestProposalNumber += 1
node.DepositProposal(chain.LatestProposalNumber, true)
totalTimeChan := make(chan time.Duration, 1)
go node.QueryPropStatusTimed(chain.LatestProposalNumber, "PROPOSAL_STATUS_PASSED", totalTimeChan)
for _, node := range chain.NodeConfigs {
node.VoteYesProposal(initialization.ValidatorWalletName, chain.LatestProposalNumber)
}
// if querying proposal takes longer than timeoutPeriod, stop the goroutine and error
var elapsed time.Duration
timeoutPeriod := time.Duration(2 * time.Minute)
select {
case elapsed = <-totalTimeChan:
case <-time.After(timeoutPeriod):
err := fmt.Errorf("go routine took longer than %s", timeoutPeriod)
s.Require().NoError(err)
}

// compare the time it took to reach pass status to expected expedited voting period
expeditedVotingPeriodDuration := time.Duration(chain.ExpeditedVotingPeriod * 1000000000)
timeDelta := elapsed - expeditedVotingPeriodDuration
// ensure delta is within one second of expected time
s.Require().Less(timeDelta, time.Second)
s.T().Logf("expeditedVotingPeriodDuration within one second of expected time: %v", timeDelta)
close(totalTimeChan)
}
16 changes: 9 additions & 7 deletions tests/e2e/initialization/chain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ import (

func main() {
var (
valConfig []*initialization.NodeConfig
dataDir string
chainId string
config string
votingPeriod time.Duration
forkHeight int
valConfig []*initialization.NodeConfig
dataDir string
chainId string
config string
votingPeriod time.Duration
expeditedVotingPeriod time.Duration
forkHeight int
)

flag.StringVar(&dataDir, "data-dir", "", "chain data directory")
flag.StringVar(&chainId, "chain-id", "", "chain ID")
flag.StringVar(&config, "config", "", "serialized config")
flag.DurationVar(&votingPeriod, "voting-period", 30000000000, "voting period")
flag.DurationVar(&expeditedVotingPeriod, "expedited-voting-period", 20000000000, "expedited voting period")
flag.IntVar(&forkHeight, "fork-height", 0, "fork height")

flag.Parse()
Expand All @@ -41,7 +43,7 @@ func main() {
panic(err)
}

createdChain, err := initialization.InitChain(chainId, dataDir, valConfig, votingPeriod, forkHeight)
createdChain, err := initialization.InitChain(chainId, dataDir, valConfig, votingPeriod, expeditedVotingPeriod, forkHeight)
if err != nil {
panic(err)
}
Expand Down
13 changes: 7 additions & 6 deletions tests/e2e/initialization/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ var (
OsmoToken = sdk.NewInt64Coin(OsmoDenom, IbcSendAmount) // 3,300uosmo
StakeToken = sdk.NewInt64Coin(StakeDenom, IbcSendAmount) // 3,300ustake
tenOsmo = sdk.Coins{sdk.NewInt64Coin(OsmoDenom, 10_000_000)}
fiftyOsmo = sdk.Coins{sdk.NewInt64Coin(OsmoDenom, 50_000_000)}
)

func addAccount(path, moniker, amountStr string, accAddr sdk.AccAddress, forkHeight int) error {
Expand Down Expand Up @@ -166,7 +167,7 @@ func updateModuleGenesis[V proto.Message](appGenState map[string]json.RawMessage
return nil
}

func initGenesis(chain *internalChain, votingPeriod time.Duration, forkHeight int) error {
func initGenesis(chain *internalChain, votingPeriod, expeditedVotingPeriod time.Duration, forkHeight int) error {
// initialize a genesis file
configDir := chain.nodes[0].configDir()
for _, val := range chain.nodes {
Expand Down Expand Up @@ -249,7 +250,7 @@ func initGenesis(chain *internalChain, votingPeriod time.Duration, forkHeight in
return err
}

err = updateModuleGenesis(appGenState, govtypes.ModuleName, &govtypes.GenesisState{}, updateGovGenesis(votingPeriod))
err = updateModuleGenesis(appGenState, govtypes.ModuleName, &govtypes.GenesisState{}, updateGovGenesis(votingPeriod, expeditedVotingPeriod))
if err != nil {
return err
}
Expand Down Expand Up @@ -358,12 +359,12 @@ func updateCrisisGenesis(crisisGenState *crisistypes.GenesisState) {
crisisGenState.ConstantFee.Denom = OsmoDenom
}

func updateGovGenesis(votingPeriod time.Duration) func(*govtypes.GenesisState) {
func updateGovGenesis(votingPeriod, expeditedVotingPeriod time.Duration) func(*govtypes.GenesisState) {
return func(govGenState *govtypes.GenesisState) {
govGenState.VotingParams = govtypes.VotingParams{
VotingPeriod: votingPeriod,
}
govGenState.VotingParams.VotingPeriod = votingPeriod
govGenState.VotingParams.ExpeditedVotingPeriod = expeditedVotingPeriod
govGenState.DepositParams.MinDeposit = tenOsmo
govGenState.DepositParams.MinExpeditedDeposit = fiftyOsmo
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/initialization/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/osmosis-labs/osmosis/v11/tests/e2e/util"
)

func InitChain(id, dataDir string, nodeConfigs []*NodeConfig, votingPeriod time.Duration, forkHeight int) (*Chain, error) {
func InitChain(id, dataDir string, nodeConfigs []*NodeConfig, votingPeriod, expeditedVotingPeriod time.Duration, forkHeight int) (*Chain, error) {
chain, err := new(id, dataDir)
if err != nil {
return nil, err
Expand All @@ -23,7 +23,7 @@ func InitChain(id, dataDir string, nodeConfigs []*NodeConfig, votingPeriod time.
chain.nodes = append(chain.nodes, newNode)
}

if err := initGenesis(chain, votingPeriod, forkHeight); err != nil {
if err := initGenesis(chain, votingPeriod, expeditedVotingPeriod, forkHeight); err != nil {
return nil, err
}

Expand Down
Loading

0 comments on commit e41d3e7

Please sign in to comment.