Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

xDai chain needs to have a few modifications for EIP-1559 #437

Closed
varasev opened this issue Jun 16, 2021 · 5 comments · Fixed by #499
Closed

xDai chain needs to have a few modifications for EIP-1559 #437

varasev opened this issue Jun 16, 2021 · 5 comments · Fixed by #499
Assignees
Labels

Comments

@varasev
Copy link
Collaborator

varasev commented Jun 16, 2021

Hello,

For EIP-1559 we have to take into account the work with TxPermission contract and zero gas price transactions on AuRa (particularly, for xDai chain). Currently, these additions are implemented in Nethermind, but not in OpenEthereum. But xDai chain currently uses these two clients. So, for OpenEthereum and EIP-1559 we need:

1. In Nethermind client we introduced a new version of TxPermission (v4) contract which allowedTxTypes getter looks like this: https://github.com/poanetwork/posdao-contracts/blob/035d109fd1c810c9f797874608276973aad1780b/contracts/base/TxPermissionV4.sol#L15-L42

So, in the new TxPermission version we replaced the _gasPrice parameter with the two params: _maxFeePerGas and _maxPriorityFeePerGas. And also added the _gasLimit parameter (not related to EIP-1559, but will be helpful for our xDai chain).

We agreed that _maxFeePerGas and _maxPriorityFeePerGas must be equal to gasPrice for the legacy transactions.

If we use the previous version of TxPermission (v3), we have the _gasPrice parameter there: https://github.com/poanetwork/posdao-contracts/blob/035d109fd1c810c9f797874608276973aad1780b/contracts/base/TxPermissionV3.sol#L36 - we agreed that Ethereum client must pass the maxFeePerGas to that parameter if the transaction type is 0x02.

Just in case, the corresponding changes in Nethermind client are here: NethermindEth/nethermind#3043

2. For Nethermind we agreed and implemented that the GASPRICE opcode (0x3a) should return zero for service transactions (both for legacy and new ones).

3. For Nethermind we agreed and implemented that for the new type of transactions (EIP-1559) a service transaction (zero gas price transaction) must have the maxFeePerGas and maxPriorityFeePerGas fields equal to zero. Please note that the service transactions are filtered by the Certifier smart contract as always (with its certified public getter).

4. For Nethermind the MinGasPrice config option was changed as follows: https://github.com/NethermindEth/nethermind/pull/3101/files. It was decided that MinGasPriceTxFilter after 1559 should use MinEffectiveMinerTip (EffectiveGasPrice - BaseFee).

Please add these changes to OpenEthereum as well (for xDai) to make its EIP-1559 behavior the same as in Nethermind.

@sunce86 sunce86 self-assigned this Jun 16, 2021
@sunce86 sunce86 added the london label Jun 16, 2021
@sunce86 sunce86 linked a pull request Aug 1, 2021 that will close this issue
@acud
Copy link

acud commented Aug 3, 2021

@sunce86 @varasev greetings from Swarm.
Does the merged PR mean that XDAI will support openethereum as a client after the london hardfork?

@varasev
Copy link
Collaborator Author

varasev commented Aug 3, 2021

@acud We plan this, but exact London block number is not defined yet. We need to test all the above changes first.

@varasev
Copy link
Collaborator Author

varasev commented Aug 3, 2021

@sunce86 Let's move the changes to another branch from dev (until we test them) because for dev we have another (urgent) PR for London activation on Kovan: #502. Just to make sure the latest changes in dev branch (based on v3.0.0-rc.4) didn't break anything in AuRa.

@sunce86
Copy link
Contributor

sunce86 commented Aug 3, 2021

@varasev
Ok, you have a branch sunce86/eip1559-for-xDai for testing.

@varasev
Copy link
Collaborator Author

varasev commented Nov 12, 2021

Done in v3.3.0-rc.9.

@varasev varasev closed this as completed Nov 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants