You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to integrate Sei’s EVM base fee calculation into my project and have extracted the function from this code.
For most blocks, my implementation gives the expected result, but for some, I see a discrepancy of -1, and for others, the difference is much larger. I’m using the mainnet parameters retrieved from seid.
Could someone provide an example of how the calculation should be done step by step, or help me verify if I’m using the correct parameters?
Here are some example blocks where I noticed a larger difference in calculations:
we still have difference but it is more rare.
It's weird that if set the maxGas passed to the `sdkContext` max gas to `maximumFeePerGas: 1000000000000.0` it works for this block:
```Block | Parent Base Fee | Calculated Fee | Actual Fee | Diff (Wei) | Parent Gas Limit | Diff (%) | Gas Price | Parent Gas Used
----------------------------------------------------------------------------------------------------
140797309 | 1000000000 | 1000000000 | 1000000000 | 0 | 10000000 | 0.0000000000% | 1100000000 | 905238```
which doesn't work with the other max gas from `consensus params` - `maxGas=10000000` used in `sdkContext` Updated to `"max_gas": "10000000"`, from https://rpc.pacific-1.sei.io/consensus_params:
```Block | Parent Base Fee | Calculated Fee | Actual Fee | Diff (Wei) | Parent Gas Limit | Diff (%) | Gas Price | Parent Gas Used
----------------------------------------------------------------------------------------------------
140797309 | 1000000000 | 1000045277 | 1000000000 | 45277 | 10000000 | 0.0045277000% | 1655316023 | 905238```
`maxGas=50000000` used in `sdkContext` - Updated to `"max_gas_wanted": "50000000"` from https://rpc.pacific-1.sei.io/consensus_params :
```Block | Parent Base Fee | Calculated Fee | Actual Fee | Diff (Wei) | Parent Gas Limit | Diff (%) | Gas Price | Parent Gas Used
----------------------------------------------------------------------------------------------------
140797309 | 1000000000 | 1000008428 | 1000000000 | 8428 | 10000000 | 0.0008428000% | 1100036488 | 905238```
And vice-versa there are some blocks which work with the max gas from consensus params - `maxGas=10000000` used in `sdkContext` Updated to `"max_gas": "10000000",` from https://rpc.pacific-1.sei.io/consensus_params:
```Block | Parent Base Fee | Calculated Fee | Actual Fee | Diff (Wei) | Parent Gas Limit | Diff (%) | Gas Price | Parent Gas Used
----------------------------------------------------------------------------------------------------
140797322 | 1000000000 | 1000014095 | 1000014095 | 0 | 10000000 | 0.0000000000% | 1100000000 | 867197
140797324 | 1000000000 | 1000313284 | 1000313284 | 0 | 10000000 | 0.0000000000% | 1100000000 | 1232207```
but doesn't work with `sdkContext` max gas to `maximumFeePerGas: 1000000000000.0` :
```Block | Parent Base Fee | Calculated Fee | Actual Fee | Diff (Wei) | Parent Gas Limit | Diff (%) | Gas Price | Parent Gas Used
----------------------------------------------------------------------------------------------------
140797322 | 1000000000 | 1000000000 | 1000014095 | -14095 | 10000000 | -0.0014094801% | 1100000000 | 867197
140797324 | 1000000000 | 1000000002 | 1000313284 | -313282 | 10000000 | -0.0313183884% | 1100000000 | 1232207```
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I’m trying to integrate Sei’s EVM base fee calculation into my project and have extracted the function from this code.
For most blocks, my implementation gives the expected result, but for some, I see a discrepancy of -1, and for others, the difference is much larger. I’m using the mainnet parameters retrieved from
seid.Could someone provide an example of how the calculation should be done step by step, or help me verify if I’m using the correct parameters?
Here are some example blocks where I noticed a larger difference in calculations:
Here are all of the results ~600 blocks: results.txt
And here is the script:
maxGas=10000000used insdkContextUpdated to"max_gas": "10000000",from https://rpc.pacific-1.sei.io/consensus_params[Using parameters]
maxGas: 50000000
priorityNormalizer: 1.0
baseFeePerGas: 0.0
maxDynamicBaseFeeUpwardAdjustment: 0.0075
maxDynamicBaseFeeDownwardAdjustment: 0.0039
minimumFeePerGas: 1000000000.0
deliverTxHookWasmGasLimit: 300000
targetGasUsedPerBlock: 850000
maximumFeePerGas: 1000000000000.0
Block | Parent Base Fee | Calculated Fee | Actual Fee | Diff (Wei) | Parent Gas Limit | Diff (%) | Gas Price
140797306 | 1000000000 | 1000000000 | 1000000000 | 0 | 10000000 | 0.0000000000% | 1100000000
140797307 | 1000000000 | 1000000000 | 1000000000 | 0 | 10000000 | 0.0000000000% | 1100000000
140797308 | 1000000000 | 1000000000 | 1000000000 | 0 | 10000000 | 0.0000000000% | 1100000000
140797309 | 1000000000 | 1000008428 | 1000000000 | 8428 | 10000000 | 0.0008428000% | 1100036488
140797310 | 1000000000 | 1000000000 | 1000000000 | 0 | 10000000 | 0.0000000000% | 1100000000
140797311 | 1000000000 | 1000000000 | 1000000000 | 0 | 10000000 | 0.0000000000% | 1100000000
140797312 | 1000000000 | 1000000000 | 1000000000 | 0 | 10000000 | 0.0000000000% | 1100000000
140797313 | 1000000000 | 1000000000 | 1000000000 | 0 | 10000000 | 0.0000000000% | 1100000000
All reactions