Skip to content

Commit

Permalink
Merge pull request #838 from moonbeam-foundation/eshaben/eip1559-tx-fees
Browse files Browse the repository at this point in the history
update wording on calculating eip-1559 transaction fees
  • Loading branch information
eshaben committed Jan 8, 2024
2 parents 0fa85c7 + f2fe2c0 commit 4cfa6fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ async function main() {
// Retrieve the block height of the current block
console.log('Block Height: ' + responseBlock.data.number);

// Due to a current bug, use the previous block's base fee
// to match the on-chain data
// Use the previous block's base fee to match the on-chain data
// Find the block's nextFeeMultiplier
const prevBlock = Number(responseBlock.data.number) - 1;
const responsePallet = await axios.get(endpointPallet + prevBlock);
Expand Down
4 changes: 2 additions & 2 deletions builders/get-started/eth-compare/tx-fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ To calculate the fee incurred on a Moonbeam transaction sent via the Ethereum AP
```

!!! note
Due to a current bug, EIP-1559 transaction fees are calculated using the previous block's base fee. As such, you can adapt your calculations to use the base fee of the previous block to match the on-chain data.
EIP-1559 transaction fees on Moonbeam are calculated using the previous block's base fee.

The following sections describe in more detail each of the components needed to calculate the transaction fee.

Expand Down Expand Up @@ -437,7 +437,7 @@ The following curl example will return the gas information of the last 10 blocks
The following code snippet uses the [Axios HTTP client](https://axios-http.com/){target=_blank} to query the [Sidecar endpoint `/blocks/head`](https://paritytech.github.io/substrate-api-sidecar/dist/#operations-tag-blocks){target=_blank} for the latest finalized block. It then calculates the transaction fees of all transactions in the block according to the transaction type (for Ethereum API: legacy, EIP-1559 or EIP-2930 standards, and for Substrate API), as well as calculating the total transaction fees in the block.

!!! note
Due to a current bug, EIP-1559 transaction fees are calculated using the previous block's base fee. As such, you can adapt your calculations to use the base fee of the previous block to match the on-chain data.
EIP-1559 transaction fees on Moonbeam are calculated using the previous block's base fee.

The following code sample is for demo purposes only and should not be used without modification and further testing in a production environment.

Expand Down

0 comments on commit 4cfa6fa

Please sign in to comment.