-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
feat(tx)!: make timeout_height time based #20870
Conversation
Warning Rate limit exceeded@sontrinh16 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 25 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughWalkthroughThe updates transition the transaction timeout mechanism from a block-height-based system to a timestamp-based approach within the Cosmos SDK. This enhancement allows for more accurate transaction management by implementing changes across various components, including decorators, transaction managers, and testing frameworks. The command-line interface has also been updated to reflect the new flag for setting timeouts, ensuring consistency and improving transaction handling and replay protection. Changes
Sequence DiagramssequenceDiagram
participant User
participant CLI
participant TxManager
participant Block
Note over User,CLI: New Transaction Flow with Timestamp
User->>CLI: Send Transaction with --timeout-timestamp
CLI->>TxManager: Validate and Process Transaction
TxManager->>Block: Check Transaction Timeout Timestamp
Block->>TxManager: Return Confirmation
TxManager->>CLI: Confirmation/Failure
CLI->>User: Transaction Processed
sequenceDiagram
participant User
participant System
participant TxManager
participant Block
Note over User,System: Old Transaction Flow with Block Height
User->>System: Send Transaction with --timeout-height
System->>TxManager: Validate and Process Transaction
TxManager->>Block: Check Transaction Timeout Height
Block->>TxManager: Return Confirmation
TxManager->>System: Confirmation/Failure
System->>User: Transaction Processed
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
This comment has been minimized.
This comment has been minimized.
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (5)
- CHANGELOG.md (2 hunks)
- client/flags/flags.go (3 hunks)
- tests/e2e/baseapp/block_gas_test.go (1 hunks)
- types/tx_msg.go (3 hunks)
- x/auth/tx/builder.go (4 hunks)
Files skipped from review as they are similar to previous changes (5)
- CHANGELOG.md
- client/flags/flags.go
- tests/e2e/baseapp/block_gas_test.go
- types/tx_msg.go
- x/auth/tx/builder.go
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- client/v2/autocli/testdata/help-echo-msg.golden (1 hunks)
Additional comments not posted (1)
client/v2/autocli/testdata/help-echo-msg.golden (1)
30-30
: LGTM! The new--timeout-timestamp
flag is correctly added.The flag is consistent with the other command-line options and the description is clear.
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.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (2)
- client/flags/flags.go (2 hunks)
- client/tx/factory.go (7 hunks)
Files skipped from review as they are similar to previous changes (1)
- client/tx/factory.go
Additional context used
Path-based instructions (1)
client/flags/flags.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (1)
client/flags/flags.go (1)
76-76
: LGTM!The addition of the
FlagTimeoutTimestamp
constant is appropriate and aligns with the PR objectives.
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- client/flags/flags.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- client/flags/flags.go
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- client/v2/autocli/testdata/help-echo-msg.golden (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- client/v2/autocli/testdata/help-echo-msg.golden
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
CHANGELOG.md (1)
64-64
: Fix grammatical error and add missing space.There is a missing space after "timeout." and "defines" should be "defining".
- Add `timeout-timestamp` field for tx body defines time based timeout.Add `WithTimeoutTimestamp` to tx factory. Increased gas cost for processing newly added timeout timestamp field in tx body. + Add `timeout-timestamp` field for tx body, defining time-based timeout. Add `WithTimeoutTimestamp` to tx factory. Increased gas cost for processing newly added timeout timestamp field in tx body.
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (3)
- CHANGELOG.md (2 hunks)
- UPGRADING.md (1 hunks)
- client/tx/factory.go (7 hunks)
Files skipped from review as they are similar to previous changes (1)
- client/tx/factory.go
Additional context used
Path-based instructions (2)
UPGRADING.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"CHANGELOG.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
Additional comments not posted (2)
UPGRADING.md (1)
106-106
: Ensure Consistency in Function Argument Naming.The argument
unorderedtx.DefaultMaxTimeoutDuration
is correctly used, but ensure consistency in naming conventions throughout the documentation and codebase.CHANGELOG.md (1)
203-203
: LGTM!The entry correctly describes the breaking changes.
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.
Pre-approving. Code LGTM, but the CHANGELOG needs to be updated to reflect exactly what is and isn't breaking, now CLI is for instance, but we aren't removing timeout height from the state machine
s.Require().Equal(286, testTxs[5].size) | ||
s.Require().Equal(277, testTxs[6].size) | ||
s.Require().Equal(277, testTxs[7].size) | ||
s.Require().Equal(277, testTxs[8].size) |
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.
Unrelated to this PR but these types of tests are fragile and hard to maintain.
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (3)
- CHANGELOG.md (2 hunks)
- UPGRADING.md (1 hunks)
- baseapp/abci_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- CHANGELOG.md
- UPGRADING.md
- baseapp/abci_test.go
…smos/cosmos-sdk into son/timeout_height_time_based
Co-authored-by: Marko <marko@baricevic.me> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> (cherry picked from commit 5853356)
Description
ref: 20658
txbody
TxTimeoutHeightDecorator
andUnorderedTxDecorator
validateTx check accounts for timeout timestampAuthor Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
Summary by CodeRabbit
New Features
timeout-timestamp
flag for transaction time-based timeout.Bug Fixes
Documentation
timeout_timestamp
.Chores