-
Notifications
You must be signed in to change notification settings - Fork 283
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
WIP: overrides the timeout_commit and timeout_propose in v3 #3882
Draft
staheri14
wants to merge
73
commits into
main
Choose a base branch
from
sanaz/modify-timeouts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
8ef416b
introduces timeout propose and commit consts
staheri14 0cd25d3
sets tiemouts in EndBlocker based on the updated version
staheri14 a878a20
sets timeout propose of v3 to 10
staheri14 20b62ef
retrieves timeouts based on the app version
staheri14 14abdab
points to a new version of core
staheri14 33b2f7f
adds a todo
staheri14 dc127da
displaying the timeout propose in the logs
staheri14 7efde46
minor correction on a comment
staheri14 3eca59d
sets the initial values of timeouts according to the latest version s…
staheri14 861309f
adds a todo
staheri14 789bc23
gets timeouts in info
staheri14 3158757
bumps core
staheri14 75a5016
return timouts in the Info call
staheri14 539d4d6
refactors the code based on the new core
staheri14 c64caa3
Merge remote-tracking branch 'origin/main' into sanaz/modify-timeouts
staheri14 a6d5c1d
updates the core version with new InitChain
staheri14 81e7f9b
sends back timeouts in the InitChainResponse
staheri14 0dbe35c
adds a reminder
staheri14 1984704
Merge remote-tracking branch 'origin/main' into sanaz/modify-timeouts
staheri14 be3bf26
adding a todo
staheri14 76eb2fb
deletes stale comment
staheri14 bc2e04c
indicates that the long form of the flags are used using double hypen
staheri14 07daa0b
passes the key-path
staheri14 8ac82fe
modifies a godoc
staheri14 76fd45d
fixes a typo
staheri14 da8c5e4
wip test
staheri14 31a7f36
sets the timeouts according to the app version in the current block h…
staheri14 6b2f58e
adds checks for timeouts in the V3Upgrade tests
staheri14 eb2dab5
bumps core
staheri14 345ecc0
updates test for new timeout logic at pre-upgrade height
staheri14 cdef177
extends timeout checks to the initChain calls
staheri14 510fb4c
reverts major upgrade e2e tests back to its initial version
staheri14 67e702b
bumps core
staheri14 d67a2fe
changes default configs for testing purposes
staheri14 ebadbd8
fixes test name
staheri14 c2a804f
adds a test file
staheri14 759e650
adds some checks over the abci responses
staheri14 ac4e88e
Merge remote-tracking branch 'origin/main' into sanaz/fix-txclient-flags
staheri14 71fb648
logs txclient args for visibility and debugging
staheri14 f15e64e
Merge branch 'main' into sanaz/modify-timeouts
staheri14 6794d0f
Merge branch 'sanaz/fix-txclient-flags' into sanaz/modify-timeouts
staheri14 a184376
updates e2e benchmark test branch to the current branch
staheri14 6027fb3
bumps core
staheri14 05ebaa7
reduces timeouts to the total of 6 s
staheri14 ba95e0b
bumps core
staheri14 ab41d7b
Merge remote-tracking branch 'origin/main' into sanaz/modify-timeouts
staheri14 c1abf94
allows changing app version in the genesis
staheri14 d9d5231
adds some utilities to calculate block time stats
staheri14 721910d
bumps core
staheri14 072d17d
bumps core
staheri14 0e20204
bumps core
staheri14 4ac2c73
fixes godocs
staheri14 0e3c631
adds a test for v3 in biglbokcs
staheri14 cdba0b7
allows access to the cometbft node in testnode
staheri14 e160793
updates Timeouts test
staheri14 f10dd3b
adds util to get genesis app version in e2e tests
staheri14 2d818d6
includes timeouts test in the main
staheri14 2497800
updates testnet to delay the start of some of the genesis nodes
staheri14 7280b4f
fixes an issue with starting a subset of nodes
staheri14 1fddc7b
starts tx clients seletively
staheri14 6c6f247
delays one of the validators
staheri14 853abb7
adds a log message to indicate the remainder of validators could not …
staheri14 910e2df
bumps core to a version with a fix to the start time after the genesi…
staheri14 8fa70a3
adds an integration test for timeouts
staheri14 b86606c
clarifies some comments
staheri14 409d834
Merge remote-tracking branch 'origin/main' into sanaz/modify-timeouts
staheri14 6bb63ba
bumps core to the version with new endpoints for timeouts
staheri14 104740d
fixes timeouts e2e test
staheri14 e7d990b
verifies timeouts at the end of v3 upgrade tests
staheri14 fb2fdab
adds further logs and checks the initial timeouts
staheri14 81d8415
reduces upgrade delay
staheri14 75d7a9a
reorganizes the test to check timeouts after upgrade is complete
staheri14 79595cd
creates one client for all the height checks
staheri14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package app_test | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/celestiaorg/celestia-app/v3/pkg/appconsts" | ||
"github.com/celestiaorg/celestia-app/v3/test/util/testfactory" | ||
"github.com/celestiaorg/celestia-app/v3/test/util/testnode" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/celestiaorg/celestia-app/v3/app" | ||
"github.com/celestiaorg/celestia-app/v3/app/encoding" | ||
"github.com/celestiaorg/celestia-app/v3/pkg/user" | ||
) | ||
|
||
func TestTimeoutTestSuite(t *testing.T) { | ||
if testing.Short() { | ||
t.Skip("skipping app/test/timeouts_test in short mode.") | ||
} | ||
suite.Run(t, &TimeoutTestSuite{}) | ||
} | ||
|
||
type TimeoutTestSuite struct { | ||
suite.Suite | ||
|
||
ecfg encoding.Config | ||
accounts []string | ||
cctx testnode.Context | ||
} | ||
|
||
const ( | ||
timeoutPropose = 7 * time.Second | ||
timeoutCommit = 8 * time.Second | ||
) | ||
|
||
func (s *TimeoutTestSuite) SetupSuite() { | ||
t := s.T() | ||
s.accounts = testnode.RandomAccounts(142) | ||
|
||
cfg := testnode.DefaultConfig().WithFundedAccounts(s.accounts...) | ||
cfg.TmConfig.Consensus.TimeoutPropose = timeoutPropose | ||
cfg.TmConfig.Consensus.TimeoutCommit = timeoutCommit | ||
|
||
cctx, _, _ := testnode.NewNetwork(t, cfg) | ||
|
||
s.cctx = cctx | ||
s.ecfg = encoding.MakeConfig(app.ModuleEncodingRegisters...) | ||
|
||
require.NoError(t, cctx.WaitForNextBlock()) | ||
|
||
for _, acc := range s.accounts { | ||
addr := testfactory.GetAddress(s.cctx.Keyring, acc) | ||
_, _, err := user.QueryAccount(s.cctx.GoContext(), s.cctx.GRPCClient, s.cctx.InterfaceRegistry, addr) | ||
require.NoError(t, err) | ||
} | ||
} | ||
|
||
// TestConfigTimeoutsOverride verifies that the timeouts specified in the | ||
// configs are not used, | ||
// and instead the timeouts are overridden by the ABCI InitChain response | ||
// depending on the genesis app version. | ||
func (s *TimeoutTestSuite) TestConfigTimeoutsOverride() { | ||
t := s.T() | ||
|
||
require.NoError(t, s.cctx.WaitForBlocks(1)) | ||
|
||
tmNode := s.cctx.GetTMNode() | ||
configTimeoutPropose := tmNode.Config().Consensus.TimeoutPropose.Seconds() | ||
configTimeoutCommit := tmNode.Config().Consensus.TimeoutCommit.Seconds() | ||
|
||
// double-check the config timeouts are the same as the ones we set | ||
assert.Equal(t, timeoutPropose.Seconds(), configTimeoutPropose) | ||
assert.Equal(t, timeoutCommit.Seconds(), configTimeoutCommit) | ||
|
||
// read the timeouts from the state at height 1 i.e., | ||
//the state after applying the genesis file | ||
state1, err := s.cctx.GetTMNode().ConsensusStateTimeoutsByHeight(1) | ||
require.NoError(t, err) | ||
|
||
// state timeouts should NOT match the timeouts of the config | ||
assert.True(t, configTimeoutPropose != state1.TimeoutPropose.Seconds()) | ||
assert.True(t, configTimeoutCommit != state1.TimeoutCommit.Seconds()) | ||
|
||
// state timeouts should match the timeouts of the latest version of the app | ||
assert.Equal(t, appconsts.GetTimeoutCommit(appconsts.LatestVersion), state1.TimeoutCommit) | ||
assert.Equal(t, appconsts.GetTimeoutPropose(appconsts.LatestVersion), state1.TimeoutPropose) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,7 +30,7 @@ const ( | |||||
// DefaultUpgradeHeightDelay is the number of blocks after a quorum has been | ||||||
// reached that the chain should upgrade to the new version. Assuming a block | ||||||
// interval of 12 seconds, this is 7 days. | ||||||
DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. | ||||||
DefaultUpgradeHeightDelay = 3 // int64( 7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
) | ||||||
|
||||||
var ( | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package v3 | ||
|
||
import "time" | ||
|
||
const ( | ||
Version uint64 = 3 | ||
SquareSizeUpperBound int = 128 | ||
SubtreeRootThreshold int = 64 | ||
TxSizeCostPerByte uint64 = 10 | ||
GasPerBlobByte uint32 = 8 | ||
TimeoutPropose = time.Second * 3 | ||
TimeoutCommit = time.Second * 1 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,7 +4,7 @@ | |||||
|
||||||
# Stop script execution if an error is encountered | ||||||
set -o errexit | ||||||
# Stop script execution if an undefined variable is used | ||||||
# Stop scyript execution if an undefined variable is used | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
set -o nounset | ||||||
|
||||||
if ! [ -x "$(command -v celestia-appd)" ] | ||||||
|
@@ -89,6 +89,12 @@ createGenesis() { | |||||
trace_push_batch_size=1000 | ||||||
sed -i.bak -e "s/^trace_push_batch_size *=.*/trace_push_batch_size = \"$trace_push_batch_size\"/" ${CELESTIA_APP_HOME}/config/config.toml | ||||||
|
||||||
timeout_propose="100s" | ||||||
sed -i.bak -e "s/^timeout_propose *=.*/timeout_propose = \"$timeout_propose\"/" ${CELESTIA_APP_HOME}/config/config.toml | ||||||
|
||||||
timeout_commit="900s" | ||||||
sed -i.bak -e "s/^timeout_commit *=.*/timeout_commit = \"$timeout_commit\"/" ${CELESTIA_APP_HOME}/config/config.toml | ||||||
|
||||||
echo "Tracing is set up with the ability to pull traced data from the node on the address http://127.0.0.1${trace_pull_address}" | ||||||
} | ||||||
|
||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should line 146 have this?
// time. The expected block time is 6 seconds, therefore this value is 30