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

chore: increase default valid_sig_block_period #348

Merged
merged 3 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions x/auth/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (suite *AnteTestSuite) TestAnteHandlerSigErrors() {
func (suite *AnteTestSuite) TestAnteHandlerSigBlockHeight() {
suite.SetupTest(false) // reset

suite.ctx = suite.ctx.WithBlockHeight(200) // init block height is 200
suite.ctx = suite.ctx.WithBlockHeight(5000) // init block height is 5000

// Same data for every test cases
accounts := suite.CreateTestAccounts(2)
Expand All @@ -182,7 +182,7 @@ func (suite *AnteTestSuite) TestAnteHandlerSigBlockHeight() {
msg := testdata.NewTestMsg(accounts[0].acc.GetAddress())
msgs = []sdk.Msg{msg}

privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv}, []uint64{100}, []uint64{0}
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv}, []uint64{3600}, []uint64{0}
},
false,
true,
Expand All @@ -200,7 +200,7 @@ func (suite *AnteTestSuite) TestAnteHandlerSigBlockHeight() {
{
"new tx from correct sig block height",
func() {
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv}, []uint64{100}, []uint64{1}
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv}, []uint64{3600}, []uint64{1}
},
false,
true,
Expand All @@ -221,7 +221,7 @@ func (suite *AnteTestSuite) TestAnteHandlerSigBlockHeight() {
{
"new tx with correct sig block height",
func() {
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv, accounts[1].priv}, []uint64{100, 101}, []uint64{2, 0}
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv, accounts[1].priv}, []uint64{3600, 3601}, []uint64{2, 0}
},
false,
true,
Expand Down
2 changes: 1 addition & 1 deletion x/auth/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
DefaultTxSizeCostPerByte uint64 = 10
DefaultSigVerifyCostED25519 uint64 = 590
DefaultSigVerifyCostSecp256k1 uint64 = 1000
DefaultValidSigBlockPeriod uint64 = 100
DefaultValidSigBlockPeriod uint64 = 3600 // 1 hour for 1 second block interval
)

// Parameter keys
Expand Down