Skip to content

fix: post zero priority fee to avoid gas price bump failure in zetacore#3933

Closed
lumtis wants to merge 3 commits intodevelopfrom
fix/disable-priority-fee
Closed

fix: post zero priority fee to avoid gas price bump failure in zetacore#3933
lumtis wants to merge 3 commits intodevelopfrom
fix/disable-priority-fee

Conversation

@lumtis
Copy link
Contributor

@lumtis lumtis commented May 29, 2025

#3931

Update the change on develop as well.

Summary by CodeRabbit

  • Bug Fixes
    • The priority fee is now fixed to zero for all transactions, ensuring compatibility with legacy transaction formats and avoiding issues with EIP-1559 fee logic.
  • Tests
    • Updated test mocks to allow certain method calls to be optional.
    • Temporarily disabled a test related to EIP-1559 support, with a note for future re-enablement.

…re (#3930)

* fix gas price bump failure by posting zero priority fee

* directly use 0 of uint64 for priority fee
@lumtis lumtis requested a review from a team as a code owner May 29, 2025 07:37
@lumtis lumtis added the no-changelog Skip changelog CI check label May 29, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 29, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

The changes hardcode the priority fee to zero in the PostGasPrice method, reflecting the use of legacy transactions instead of EIP-1559 transactions. The method for determining the priority fee is now exported and renamed accordingly. In tests, mock expectations are made optional, and the EIP-1559 test case is disabled.

Changes

File(s) Change Summary
zetaclient/chains/evm/observer/observer_gas.go Hardcoded priority fee to zero in PostGasPrice; commented out dynamic logic; renamed and exported DeterminePriorityFee.
zetaclient/chains/evm/observer/observer_gas_test.go Made mock expectations optional with .Maybe(); commented out EIP-1559 test case with a TODO for future re-enablement.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Observer
    participant PostVoteGasPrice

    Client->>Observer: PostGasPrice()
    Note right of Observer: Priority fee set to zero (legacy tx)
    Observer->>PostVoteGasPrice: PostVoteGasPrice(gasPrice, 0)
Loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link

codecov bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.84%. Comparing base (c796d35) to head (9f6bd0d).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3933      +/-   ##
===========================================
- Coverage    64.92%   64.84%   -0.08%     
===========================================
  Files          471      471              
  Lines        34413    34417       +4     
===========================================
- Hits         22343    22319      -24     
- Misses       11036    11069      +33     
+ Partials      1034     1029       -5     
Files with missing lines Coverage Δ
zetaclient/chains/evm/observer/observer.go 69.28% <ø> (ø)
zetaclient/chains/evm/observer/observer_gas.go 22.97% <100.00%> (-35.60%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
zetaclient/chains/evm/observer/observer_gas.go (1)

25-28: Consider removing commented code to reduce technical debt.

The commented implementation preserves the original logic but creates maintenance overhead. Consider either removing this code entirely or documenting a clear timeline for restoration if this change is intended to be temporary.

If this is a permanent change, apply this diff:

-	// PRIORITY FEE (EIP-1559)
-	// priorityFee, err := ob.determinePriorityFee(ctx)
-	// if err != nil {
-	// 	return errors.Wrap(err, "unable to determine priority fee")
-	// }
+	// PRIORITY FEE (EIP-1559) - Disabled per issue #3221
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c796d35 and 8b78e1a.

📒 Files selected for processing (2)
  • zetaclient/chains/evm/observer/observer_gas.go (3 hunks)
  • zetaclient/chains/evm/observer/observer_gas_test.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

**/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

  • zetaclient/chains/evm/observer/observer_gas.go
  • zetaclient/chains/evm/observer/observer_gas_test.go
🪛 GitHub Check: codecov/patch
zetaclient/chains/evm/observer/observer_gas.go

[warning] 48-48: zetaclient/chains/evm/observer/observer_gas.go#L48
Added line #L48 was not covered by tests

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: start-e2e-test / e2e
🔇 Additional comments (2)
zetaclient/chains/evm/observer/observer_gas.go (1)

18-22: Architectural decision documented with clear rationale.

The hardcoded priority fee approach is well-documented with relevant issue links and context. This represents a deliberate shift from dynamic EIP-1559 transaction support to legacy transactions to prevent gas price bump failures.

zetaclient/chains/evm/observer/observer_gas_test.go (1)

27-31: Mock expectations appropriately relaxed for simplified gas price logic.

The addition of .Maybe() to the mock calls correctly reflects that PostGasPrice no longer deterministically calls these methods since priority fee determination is now hardcoded.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c796d35 and 8b78e1a.

📒 Files selected for processing (2)
  • zetaclient/chains/evm/observer/observer_gas.go (3 hunks)
  • zetaclient/chains/evm/observer/observer_gas_test.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

**/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

  • zetaclient/chains/evm/observer/observer_gas_test.go
  • zetaclient/chains/evm/observer/observer_gas.go
🪛 GitHub Check: codecov/patch
zetaclient/chains/evm/observer/observer_gas.go

[warning] 48-48: zetaclient/chains/evm/observer/observer_gas.go#L48
Added line #L48 was not covered by tests

🔇 Additional comments (3)
zetaclient/chains/evm/observer/observer_gas_test.go (1)

27-27: LGTM: Mock expectations appropriately made optional.

The addition of .Maybe() to the mock expectations correctly reflects that these RPC calls may no longer be invoked due to the hardcoded priority fee implementation.

Also applies to: 30-31

zetaclient/chains/evm/observer/observer_gas.go (2)

18-22: LGTM: Clear documentation of the hardcoded approach.

The comments effectively explain the rationale for hardcoding the priority fee to zero, with appropriate references to the underlying issue and related code.


37-37: LGTM: Correctly updated method call parameter.

The change from priorityFee.Uint64() to priorityFee correctly reflects the new type (uint64 instead of *big.Int).

@lumtis
Copy link
Contributor Author

lumtis commented May 30, 2025

#3934 (review)

@lumtis lumtis closed this May 30, 2025
@lumtis lumtis deleted the fix/disable-priority-fee branch September 24, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Skip changelog CI check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants