Skip to content
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(state/core_accessor): add fee estimator #4087

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vgonkivs
Copy link
Member

@vgonkivs vgonkivs commented Feb 4, 2025

This PR enables third-party estimation for the submit transactions in the node(besides PFB). By default, fee estimation relies on the consensus node to which the node is connected. But the user can now provide a non-default endpoint, so the node will query gas price and gas from it. It can be provided via cli(using "core.estimator.address"). The address will be added to the node's config as FeeEstimatorAddress.
Additionally, the user can now provide a maxGasPrice for every submit tx(via max.gas.price flag)- the max price that the user is willing to pay for the transaction. The transaction will not be submitted in case when estimated gas price exceeds the maxGasPrice(default: minGasPrice*100)

@vgonkivs vgonkivs added area:state Related to fetching state and state execution kind:feat Attached to feature PRs labels Feb 4, 2025
@vgonkivs vgonkivs self-assigned this Feb 4, 2025
@vgonkivs vgonkivs force-pushed the fee_estimator branch 2 times, most recently from 90f851c to 7c01a6f Compare February 4, 2025 15:07
@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 66.89189% with 49 lines in your changes missing coverage. Please review.

Project coverage is 45.14%. Comparing base (2469e7a) to head (6fc589d).
Report is 443 commits behind head on main.

Files with missing lines Patch % Lines
state/estimator.go 54.16% 17 Missing and 5 partials ⚠️
state/tx_config.go 51.61% 15 Missing ⚠️
state/core_access.go 76.00% 4 Missing and 2 partials ⚠️
nodebuilder/core/flags.go 66.66% 3 Missing and 1 partial ⚠️
nodebuilder/state/cmd/state.go 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4087      +/-   ##
==========================================
+ Coverage   44.83%   45.14%   +0.30%     
==========================================
  Files         265      309      +44     
  Lines       14620    22660    +8040     
==========================================
+ Hits         6555    10229    +3674     
- Misses       7313    11337    +4024     
- Partials      752     1094     +342     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vgonkivs vgonkivs marked this pull request as ready for review February 13, 2025 16:06
go.mod Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:state Related to fetching state and state execution kind:feat Attached to feature PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants