Use LatestSigner and don't set GasPrice in ContractBackend#322
Merged
matthiasgeihs merged 4 commits intohyperledger-labs:mainfrom Feb 14, 2022
Merged
Use LatestSigner and don't set GasPrice in ContractBackend#322matthiasgeihs merged 4 commits intohyperledger-labs:mainfrom
matthiasgeihs merged 4 commits intohyperledger-labs:mainfrom
Conversation
Contributor
|
I can confirm that this change has the expected result 👍 I wrote a small application and this tx uses the updated logic from go-perun to make a contract call and it is of type 2 💪 |
- Before, types.EIP155Signer's were created in many different places. It is recommended by the geth folks to use types.LatestSigner instead. This was streamlined an there's now a common channel/test.SimSigner that can always be used together with the simulated backend. - FundAddress and Test_ConfirmTransaction were adapted to use the new types.DynamicFeeTx. - The unused test.GasLimit variable was deleted. - The test.GasPrice variable was renamed to InitialGasBaseFee and its description updated. Signed-off-by: Sebastian Stammler <seb@perun.network>
Setting TransactOpts.GasPrice forces the transactions to be sent as a legacy transaction, instead of a type 2 EIP1559, which results in much higher gas costs. Also remove the SuggestedGasPrice method from the SimulatedBackend, as it is not used anymore, because EIP1559 TXs are now sent everywhere. Signed-off-by: Sebastian Stammler <seb@perun.network>
Signed-off-by: Sebastian Stammler <seb@perun.network>
7b76bfa to
cfc91d6
Compare
Signed-off-by: Sebastian Stammler <seb@perun.network>
cfc91d6 to
b521bd4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
types.EIP155Signers were created in many different places.It is recommended by the geth folks to use
types.LatestSignerinstead.This was streamlined an there's now a common
channel/test.SimSignerthatcan always be used together with the simulated backend.
FundAddressandTest_ConfirmTransactionwere adapted to use thenew
types.DynamicFeeTx.test.GasLimitvariable was deleted.test.GasPricevariable was renamed toInitialGasBaseFeeand itsdescription updated.
GasPriceinContractBackend.NewTransactorTransactOpts.GasPriceforces the transactions to be sent as alegacy transaction, instead of a type 2 EIP1559, which results in much
higher gas costs.
SuggestedGasPricemethod from theSimulatedBackend, asit is not used anymore, because EIP1559 TXs are now sent everywhere.
Opened as a draft to let @ndzik try it out first if we truly now send EIP1559 txs.
Original issue in Erdstall is at https://github.com/perun-network/erdstall-ext/issues/121