Skip to content

feat: query gas price from chain #741

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

Merged
merged 1 commit into from
May 22, 2025

Conversation

jinoosss
Copy link
Member

What type of PR is this?

  • feature

What this PR does:

This PR implements direct gas price querying from the chain instead of using the indexer. The changes include updating the gas price calculation logic and simplifying the related interfaces.

Changes

  • Implement getGasPrice method in GnoProvider to query gas price directly from chain
  • Update gas price constants and calculation logic
  • Simplify gas price related interfaces and remove unnecessary complexity
  • Remove indexer-based gas price fetching

Technical Details

Gas Price Query

  • Added new ABCI query endpoint for gas price
  • Implemented gas price parsing from chain response
  • Updated gas price calculation with new base values

Interface Changes

  • Simplified ITransactionGasRepository interface
  • Removed GasPriceTierInfo type

@jinoosss jinoosss requested a review from a team as a code owner May 19, 2025 12:37
@jinoosss jinoosss requested review from dongwon8247 and tfrg May 19, 2025 12:37
FAST: 4,
AVERAGE: 2.5,
FAST: 1.2,
AVERAGE: 1.1,
Copy link
Member

Choose a reason for hiding this comment

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

Do you think this will be sufficient? (I get the reason because it's from the chain, which is more correct and reliable)

Copy link
Member

Choose a reason for hiding this comment

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

Just tested, transactions don't go through with the suggested average value. It goes through with the fast option.

We need to find the right multiplier that's just enough to make a transaction go through, which we should use for the average option.

Copy link
Member

Choose a reason for hiding this comment

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

Also, currently, users can send transactions even if the transaction fee is too little to send a transaction.

  1. We need to know the lowest, minimum value that can make transactions go through
  2. If the Network Fee is lower than that, then we should error out

Copy link
Member Author

Choose a reason for hiding this comment

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

That's right,
sets the gasUsed data from simulating the current transaction to the minimum value.
I'll have to find the right weighting values through testing.

The handling of values less than the minimum will be covered in the migration task.

@jinoosss jinoosss merged commit 17c1146 into main May 22, 2025
2 checks passed
@jinoosss jinoosss deleted the ADN-713-feat-query-gas-price-from-chain branch May 22, 2025 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants