Skip to content

Conversation

@gacevicljubisa
Copy link
Member

@gacevicljubisa gacevicljubisa commented Jul 3, 2025

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

  • Removes deprecated SuggestGasPrice from codebase and replaces it with logic used in suggestedFeeAndTip method.
  • Adds minimum-gas-tip-cap flag, minimum gas tip cap in wei for transactions, default 0 means use suggested gas tip cap.
  • Adds unit tests for SuggestedFeeAndTip in wrapped package.
  • Ensures when user use Gas-Price header, that that value is used for the gas fee.
  • Removes unused functions from wrapped package

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

@gacevicljubisa gacevicljubisa linked an issue Jul 3, 2025 that may be closed by this pull request
@gacevicljubisa gacevicljubisa changed the title fix: remove SuggestGasPrice fix: replace SuggestGasPrice with custom SuggestedFeeAndTip Jul 4, 2025
@gacevicljubisa gacevicljubisa marked this pull request as ready for review July 4, 2025 12:34
Copy link
Member

@janos janos left a comment

Choose a reason for hiding this comment

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

I have only one comment related to inner-dependencies.

@gacevicljubisa gacevicljubisa requested a review from janos July 7, 2025 16:36

var gasFeeCap *big.Int

if gasPrice == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can gasPrice == 0 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, when the Gas-Price header is used and explicitly set to 0.
This would effectively create a transaction with zero gas fees, which would likely fail when submitted to the network since miners require some compensation for processing transactions.

DefaultTipBoostPercent = 25
MinimumGasTipCap = 1_500_000_000 // 1.5 Gwei
RedistributionTipBoostPercent = 50
MinimumGasTipCap = 1_500_000_000 // 1.5 Gwei
Copy link
Member

Choose a reason for hiding this comment

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

this is really arbitrary,I would make it configurable too with defaulting only to the suggestions.

Copy link
Member Author

Choose a reason for hiding this comment

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

To have it as a additiional config flag, but default should be suggested gas tip from eth_maxPriorityFeePerGas?

@martinconic
Copy link
Contributor

Is there a way we can manually test this? How did you tested it?

@gacevicljubisa
Copy link
Member Author

Is there a way we can manually test this? How did you tested it?

You can execute any transaction manually, for example create a postage batch.
Also, I have added unit tests.

}

func (b *wrappedBackend) Close() error {
func (b *wrappedBackend) Close() {
Copy link
Member

Choose a reason for hiding this comment

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

just my 2 cents,
changing this does not seem necessary - even though ethclient.Client implements the Close() method like this.
I think it is better to use Bee common interfaces for similar functionalities such as Close() and if it does not return error (atm) then just return nil as it was before.
by that the code seems more consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

Constructor wrapped.NewBackend needs to accept ethclient.Client, which implements Close(), so it was easier to remove error.

const loggerName = "redistributionContract"
const (
loggerName = "redistributionContract"
BoostTipPercent = 50
Copy link
Member

Choose a reason for hiding this comment

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

in a future PR, this could be dynamic based on how far the node is from the end of the round phase. wdyt?

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 is nice idea

@gacevicljubisa gacevicljubisa merged commit 15a8d02 into master Jul 29, 2025
15 checks passed
@gacevicljubisa gacevicljubisa deleted the remove-suggested-gas-price branch July 29, 2025 13:22
@bcsorvasi bcsorvasi added this to the v2.7.0 milestone Oct 8, 2025
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.

Remove deprecated SuggestGasPrice from codebase

7 participants