-
Notifications
You must be signed in to change notification settings - Fork 649
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
Add Dynamic fee transactions, EIP-1559 for London #2013
Commits on Aug 6, 2021
-
First steps for EIP-1559 support
- add initial EIP-1559 transaction validation - add initial EIP-1559 transaction execution - rename gas_target to gas_limit - add london VM in existing tests - update block according to latest EIP updates
Configuration menu - View commit details
-
Copy full SHA for 5b205e6 - Browse repository at this point
Copy the full SHA 5b205e6View commit details
Commits on Aug 19, 2021
-
- prefer exceptions for base gas fee to None, where feasible - update mainnet block number for London - increase default gas price in tests to 10 gwei to easily out-price the 1559 min gas fee of 1gwei - make old transactions understand max_priority_fee_per_gas and max_fee_per_gas (just return the gas_price, as the 1559 spec suggests) - validate the transaction nonce on new london transactions - enable creating a genesis London header (was hard-coded to pre-London-style) generally allow create_header_from_parent to accept a None parent, for genesis creation - use the correct VM's block header when creating a temp block for txn evaluation - update tests that were configured with a gas price of < 1 gwei - Drop support for Header.from_parent which is essentially always wrong. Should use vm_class.create_header_from_parent instead. - Make eth_call free again - when running a call, set the header's base gas fee to 0 - API update: state_in_temp_block -> in_costless_state to reference ^ - Correctly load uncles across fork boundary - Add test to validate uncles across chain VMs - Use a universal header sedes, since we can't load the VM before decoding the header - Decode block bodies with both London and pre-London uncles - Bonus bugfix: must double the header's gas limit at the VM boundary - Implement base fee adjustment, with tests - target must be half of limit - gas_used_delta bug when parent_gas_used > parent_gas_target: was subtracting base fee instead of target - Apply gas limit rules correctly Note that the 'diff' approach had a bug when 'diff' was negative. That approach needed a math.abs() to correctly validate the limit.
Configuration menu - View commit details
-
Copy full SHA for 645aa70 - Browse repository at this point
Copy the full SHA 645aa70View commit details -
Skip all the default values for the genesis header
The alternative is to modify create_header_from_parent to accept and assign all the rest of the header fields. Since none of these values are important to customize, I'm going with this easier/smaller change.
Configuration menu - View commit details
-
Copy full SHA for 48bf83c - Browse repository at this point
Copy the full SHA 48bf83cView commit details -
Update usages of BlockHeader() and .from_parent()
Direct invocation of the header object is not allowed anymore, because different VMs now have different header types (as of EIP-1559 in London). So we must always invoke header creation through the VM. - Remove the BlockHeader() init in test_blockchain. - Remove HeaderChain, which seems to be completely unused in the code base. - Embrace that we need one global type that can decode all headers. - Add VM.create_genesis_header The genesis header now needs to be VM-aware, to handle EIP-1559. Rather than pass in a parent of None, it looks a bit cleaner to use the new create_genesis_header. - Create header from VM in opcode test (we need a proper London header at genesis)
Configuration menu - View commit details
-
Copy full SHA for bd5f34c - Browse repository at this point
Copy the full SHA bd5f34cView commit details -
Configuration menu - View commit details
-
Copy full SHA for da79f10 - Browse repository at this point
Copy the full SHA da79f10View commit details -
Choose correct header timestamp, if none supplied
Actually look at the clock, in UTC, and compare it to the parent. Related: - Fix doctests: set timestamp manually for reproducible results (new MiningChain API) - clique should verify timestamp in UTC (bug uncovered) - Only guess timestamp on non-genesis headers (when parent & VM are unavailable), so manually set in a test where headers are built manually
Configuration menu - View commit details
-
Copy full SHA for ba7cf8d - Browse repository at this point
Copy the full SHA ba7cf8dView commit details -
Validate London txn gas costs, plus tests
- Test London validation of sender sufficient funds
Configuration menu - View commit details
-
Copy full SHA for 804dfbd - Browse repository at this point
Copy the full SHA 804dfbdView commit details -
Log transaction fields dynamically
Each transaction object should now how to display itself, whether it's a legacy, access list, or dynamic fee transaction.
Configuration menu - View commit details
-
Copy full SHA for cfdc701 - Browse repository at this point
Copy the full SHA cfdc701View commit details -
Calculate miner tip correctly for EIP-1559
- add tests to verify - Push backwards-compatible usages of get_tip() to Frontier - Bonus fix: setting coinbase when mining The coinbase address was not correctly receiving transaction fees when the address is passed as a kwarg to MiningChain.mine_all or .mine_block - Bonus fix: Correctly decode dynamic-fee txns in London
Configuration menu - View commit details
-
Copy full SHA for 373c18a - Browse repository at this point
Copy the full SHA 373c18aView commit details -
Rename base gas fee transaction to dynamic fee txn
This seems to be a commonly used name, and is definitely better than BaseGasFee.
Configuration menu - View commit details
-
Copy full SHA for 7cff454 - Browse repository at this point
Copy the full SHA 7cff454View commit details -
Fix test: only thing wrong should be block number
The old test implementation was finding other problems, like a base_fee_per_gas that did not match the parent.
Configuration menu - View commit details
-
Copy full SHA for 5e0a2a2 - Browse repository at this point
Copy the full SHA 5e0a2a2View commit details -
Fix test: was testing incompatible VMs
It just didn't show up because this is the first time that the VM header validation rules vary so significantly.
Configuration menu - View commit details
-
Copy full SHA for f10c227 - Browse repository at this point
Copy the full SHA f10c227View commit details -
Fallback to get a fixture name
Not really getting anything useful from crashing there. It's an ugly crash that should be caught somewhere else.
Configuration menu - View commit details
-
Copy full SHA for 3594624 - Browse repository at this point
Copy the full SHA 3594624View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4fdeb0 - Browse repository at this point
Copy the full SHA e4fdeb0View commit details -
Halt loop if header doesn't validate gas limit
Otherwise, get an infinite loop, where test hangs.
Configuration menu - View commit details
-
Copy full SHA for 3937a0c - Browse repository at this point
Copy the full SHA 3937a0cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 295cc29 - Browse repository at this point
Copy the full SHA 295cc29View commit details