-
Notifications
You must be signed in to change notification settings - Fork 33
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(submitter): add GasPriceTTL #3474
Conversation
WalkthroughThe pull request introduces a new Changes
Sequence DiagramsequenceDiagram
participant Config as Configuration
participant Submitter as Transaction Submitter
participant Oracle as Gas Price Oracle
Config->>Submitter: Configure GasPriceTTL
Submitter->>Submitter: Check Previous Tx Timestamp
alt TTL Exceeded
Submitter->>Oracle: Fetch New Gas Price
Oracle-->>Submitter: Return Gas Price
Submitter->>Submitter: Update Transaction Gas Parameters
end
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
Deploying sanguine-fe with
|
Latest commit: |
82544fc
|
Status: | ✅ Deploy successful! |
Preview URL: | https://2f262d90.sanguine-fe.pages.dev |
Branch Preview URL: | https://feat-gas-price-ttl.sanguine-fe.pages.dev |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3474 +/- ##
===================================================
+ Coverage 34.04255% 34.06772% +0.02517%
===================================================
Files 388 388
Lines 24581 24601 +20
===================================================
+ Hits 8368 8381 +13
- Misses 15472 15482 +10
+ Partials 741 738 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
🧹 Nitpick comments (2)
ethergo/submitter/config/iconfig_generated.go (1)
36-37
: Consider describing the TTL behavior more exhaustively.These lines successfully add the GetGasPriceTTL method to the IConfig interface. You may want to add a doc comment describing expected usage and edge-case handling (e.g., TTL = 0).
ethergo/submitter/config/config.go (1)
231-239
: Add tests covering edge cases for GetGasPriceTTL.The static analysis flags these lines (232–237) as uncovered. Ensure coverage for:
• Retrieving a chain-specific TTL.
• Falling back to the global TTL.
• Zero and non-zero TTL values.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 232-237: ethergo/submitter/config/config.go#L232-L237
Added lines #L232 - L237 were not covered by tests
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
ethergo/submitter/config/config.go
(2 hunks)ethergo/submitter/config/iconfig_generated.go
(1 hunks)ethergo/submitter/submitter.go
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
ethergo/submitter/config/config.go
[warning] 232-237: ethergo/submitter/config/config.go#L232-L237
Added lines #L232 - L237 were not covered by tests
ethergo/submitter/submitter.go
[warning] 514-525: ethergo/submitter/submitter.go#L514-L525
Added lines #L514 - L525 were not covered by tests
🔇 Additional comments (2)
ethergo/submitter/submitter.go (1)
511-525
: Ensure test coverage and verify concurrency safety.
The new GasPriceTTL logic in lines 514–525 is missing test coverage (per the static analysis hint). Please consider:
- Adding unit tests to validate behavior when TTL is exceeded versus not exceeded.
- Verifying that mutating the timestamp on prevTx (prevTx.SetTime(currentTime)) is concurrency-safe if outside processes or threads might also access that struct.
Would you like me to generate sample tests or concurrency analysis scripts as a follow-up?
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 514-525: ethergo/submitter/submitter.go#L514-L525
Added lines #L514 - L525 were not covered by tests
ethergo/submitter/config/config.go (1)
52-53
: Validate default and custom TTL values.
The new GasPriceTTL field effectively configures how long a gas price can remain valid. Confirm that default or zero values do not lead to unexpected gas pricing behavior.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Summary by CodeRabbit
New Features
GasPriceTTL
field.GasPriceTTL
value for specific chains.Bug Fixes
Documentation