-
Notifications
You must be signed in to change notification settings - Fork 251
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/fee logic #969
base: release/galactica
Are you sure you want to change the base?
Feat/fee logic #969
Conversation
…using the optional rlp tag
… not enough maxFee
59565b5
to
b103881
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/galactica #969 +/- ##
====================================================
Coverage ? 61.18%
====================================================
Files ? 226
Lines ? 24073
Branches ? 0
====================================================
Hits ? 14730
Misses ? 8162
Partials ? 1181 ☔ View full report in Codecov by Sentry. |
forkConfig := thor.NoFork | ||
forkConfig.VIP191 = 1 | ||
forkConfig.BLOCKLIST = 0 | ||
forkConfig.VIP214 = 2 |
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.
Is having VIP24 on block2 something we need to address ?
@@ -78,9 +84,57 @@ func CalcBaseFee(config *thor.ForkConfig, parent *block.Header) *big.Int { | |||
y := x.Div(x, parentGasTargetBig) | |||
baseFeeDelta := x.Div(y, baseFeeChangeDenominator) | |||
|
|||
// Setting the minimun baseFee to InitialBaseFee |
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.
// Setting the minimun baseFee to InitialBaseFee | |
// Setting the minimum baseFee to InitialBaseFee |
) | ||
} | ||
} | ||
|
||
func GalacticaTxGasPriceAdapater(tr *tx.Transaction, gasPrice *big.Int) *GalacticaFeeMarketItems { |
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.
func GalacticaTxGasPriceAdapater(tr *tx.Transaction, gasPrice *big.Int) *GalacticaFeeMarketItems { | |
func GalacticaTxGasPriceAdapter(tr *tx.Transaction, gasPrice *big.Int) *GalacticaFeeMarketItems { |
@@ -121,6 +124,11 @@ func (p *Packer) Schedule(parent *chain.BlockSummary, nowTimestamp uint64) (flow | |||
} | |||
} | |||
|
|||
var baseFee *big.Int |
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.
Would it be worth adding a log saying that we've entered galactica ?
@@ -113,7 +113,6 @@ func TestP(t *testing.T) { | |||
|
|||
best := repo.BestBlockSummary() | |||
fmt.Println(best.Header.Number(), best.Header.GasUsed()) |
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.
Might want to change this print to log ?
if tx.MaxFeePerGas() == nil { | ||
return nil, errors.New("max fee per gas is required") | ||
} | ||
if tx.MaxPriorityFeePerGas() == nil { | ||
return nil, errors.New("max priority fee per gas is required") |
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.
This will be set elsewhere, even it its a legacy tx correct ?
// ErrMaxFeePerGasTooLow is returned if the transaction fee cap is less than the | ||
// the base fee of the block. | ||
ErrMaxFeePerGasTooLow = errors.New("max fee per gas is less than block base fee") |
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.
// ErrMaxFeePerGasTooLow is returned if the transaction fee cap is less than the | |
// the base fee of the block. | |
ErrMaxFeePerGasTooLow = errors.New("max fee per gas is less than block base fee") | |
// ErrMaxFeePerGasTooLow is returned if the transaction fee cap is less than | |
// the base fee of the block. | |
ErrMaxFeePerGasTooLow = errors.New("max fee per gas is less than block base fee") |
Description
This PR introduces the logic to calculate the fees dynamically based on the VIP-Dynamic Fee Market.
GHIssue
Type of change
Please delete options that are not relevant.
Checklist: