Skip to content
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

all: implement eip-1559 #22837

Merged
merged 19 commits into from
May 17, 2021
Merged

all: implement eip-1559 #22837

merged 19 commits into from
May 17, 2021

Conversation

holiman
Copy link
Contributor

@holiman holiman commented May 7, 2021

This is @lightclient 's work on 1559, but squashed. The reason for squashing it is simply that it makes it easier to rebase when the master changes.
Also, making the PR from holiman makes it possible for geth-maintainers to push to the repo.

@holiman
Copy link
Contributor Author

holiman commented May 7, 2021

This PR, I think, erroneously would accept type=2 transactions too early, before the fork block. It extends the eip2930Signer to be able to handle those types.
Running the cmd/evm/testdata/9 input on Berlin now does not throw an error in the state_transition, which is fine, but it should still throw an error due to including type=2 transactions before London.

@fjl , do you think we should extend the signers so we have a londonSigner which allows type=2, or should we explicitly check the tx type somewhere else?

@holiman
Copy link
Contributor Author

holiman commented May 7, 2021

  • New london signer
  • TODO: investigate if effective gas price in state transition is correct or not

@fjl
Copy link
Contributor

fjl commented May 7, 2021

Yes, we need a new signer every time a new tx type is added. This is also why I added the LatestSigner and related functionality. It is used across the codebase now, so you only need to update it in core/types.

@holiman holiman marked this pull request as ready for review May 7, 2021 12:07
@holiman holiman mentioned this pull request May 7, 2021
lightclient and others added 6 commits May 7, 2021 14:46
core/types: add back gasPrice

core/types: add base fee to block

params: add eip-1559 constants

consensus: verify base fee calculation

consensus: swap out custom max fn for common.math impl

params,consensus: add test fork Aleut

core: implement gas accounting for txs after eip-1559

accounts,interfaces,internal: tweak msg interface to support feeCap + tip

core: add base fee to effective gas price

core/types: add 1559 header serialization and block test

all: e2e test for eip-1559 plus some bug fixes

consensus: add test for block elasticity

consensus: add basefee to sealing hash and fix off-by-one bug in transition

consensus: check 1559 headers in clique

consensus/clique: update seal hasher to include basefee

core/types: fix 1559 signing hash

core: appease linter

core/vm: add base fee opcode

all: add comments and misc clean up

core/types: rename to DynamicFeeTx

internal/ethapi: add missing new msg parameter

consensus/misc/eip1559: improve logging

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

core/evm: default baseFee to 0 even when inactive

core/consensus: add license text to eip1559 files

core/types: update license date and simplify newmessage func

params/config: update aleut chainid

consensus/misc/eip1559: reduce big int allocations

core/state_processor: fix block elasticity

core/state_transition: throw if baseFee is invalid

cmd/evm: add eip-1559 support for t8n

core/types: add aliases for tip and feeCap json unmarshallers to match spec

consensus/misc/eip1559: better invalid baseFee error msg

core/evm: don't initialize basefee unless header includes it

core,eth,les: calculate effective gas price in tx.AsMessage(..)

consensus/misc/eip1559: check that base fee is not nil

tests/init: add new aluet testing configs

core/types/transaction_signing: update ACL reference in comment to AL

core,consensus: pass in chain config to eip1559 functions

all: clean up rebase

params/config: update baikal london block to 500

consensus: verify basefee not defined before clique fork, imporve errors

cmd/evm: account for elasticity parameter in gas limit

core: name base fee errors
params/config.go Outdated Show resolved Hide resolved
@holiman
Copy link
Contributor Author

holiman commented May 7, 2021

This PR now has support for the new changes in EIP-1559: ethereum/EIPs#3552 . Cherry-picked from quilt, credits @lightclient

(I haven't really tested/reviewed it, please help checking it)

consensus/misc/eip1559.go Outdated Show resolved Hide resolved
@holiman
Copy link
Contributor Author

holiman commented May 7, 2021

I think we should add some tests for the gasLimit and gasTarget behaviours.

Edit: Done

gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 25, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 25, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 2, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 6, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 19, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 21, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 22, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 22, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 23, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 18, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 25, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 25, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 29, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 30, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 31, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 31, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants