-
Notifications
You must be signed in to change notification settings - Fork 1
fix: Bump version: 0.12.0-beta.3 → 0.12.1-beta.1 #4
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
base: master
Are you sure you want to change the base?
Conversation
- add ``fixtures_eest`` as a submodule; use ``v4.1.0`` tarball develop fixtures - update ``fixtures`` to v14.1 - update fixture loader to pull in EEST and ethereum test fixtures - take Pyspecs fixtures out entirely, rather than collecting & skipping.
- Initial 7702 Commit - ExtCode* opcodes - 7702 CallCode opcode - Update EXTCODE* opcodes - 7702 StaticCall and DelegateCall opcodes - Adds to Prague fork classes - Comment out 7702 opcodes for now - Transaction tests are running - not correct yet - Fix lint issues; add 7702 TODOs
- Implement block requests and compute the block request hash for the block header, post-prague. - Extend the block header for Prague blocks to include the ``requests_hash``. - Some refactoring of block preprocessing to get ready for EIP-7002. This takes in the ``block``, not just the ``block.header`` as an argument so that we have access to the block requests.
- STANDARD_TOKEN_COST as per EIP-7623 is really just another way of calculating the current gas schedule. It factors the 4 out of (4 * zero_bytes) + (16 * non_zero_bytes), leaving (zero_bytes + 4 * non_zero_bytes). Leave the current schedule untouched and instead compare this to the new data_floor when finalizing the computation, subtracting more gas if necessary until we reach the data floor cost.
- g1 add, msm, and map fp to g1 - g2 add, msm, and map fp2 to g2 - pairing - bonus: bump py_ecc version - newsfragment for #2204
- Still missing some eips so some test failures are expected
- For ethereum/tests, this is provided in the pre state. If users want this functionality for testing, we need to deploy these as the respective EIPs define.
- newsfragments for #2205
- Some precompiles passing - Add chainId check - fix error msg typo - Put back process_authorizations, use correct ecrecover - Old Call tests passing - Tests for extcodesize, extcodehash, and extcodecopy passing - StaticCall tests down to 10 failing, some cleanup
- (DRY) Refactor ``BaseCall`` logic to accommodate some smaller changes to call opcodes so we don't have to re-write a bunch of code for Prague, only overwrite certain methods. - Keep static call logic unchanged. - Track message refunds separately. Even if computation fails, apply message refunds. - Fix some logic to match EIP. Along the way: - Logic for ``secp256k1n/2`` seems to have been wrong in py-evm. Fixed that check and added it to the auth validation.
- Do not pull data floor diff from refunds, nor attempt to use it from the computation gas itself. This should be calculated after refunds and separate from the computation gas. - Add an extra ``data_floor_gas`` property to the computation that is calculated by the transaction executor. This value can be used to calculate the total gas used by the transaction at any point in the processing of the computation. This is useful when issueing refunds and when making the transaction receipt.
Reviewer's GuideThis PR adds full support for the new Prague network upgrade, including a new SetCode transaction type (EIP-7702), block request processing (deposits, withdrawals, consolidations), updated gas accounting (data floor and extended refunds), unified call/delegation handling, consolidated transaction validation helpers, new BLS12-381 precompiles, and updates to versioning, fixtures, and tests. Sequence Diagram: EIP-7702 SetCode Transaction Authorization ProcessingsequenceDiagram
participant TX as SetCode Transaction
participant Executor as PragueTransactionExecutor
participant State as PragueState
participant EVM
TX->>Executor: Submitted to network
Executor->>State: calc_message_refund(TX)
State->>State: process_set_code_authorizations(TX)
loop for each auth in TX.authorization_list
State->>State: auth.validate(chain_id)
State->>EVM: ecrecover(MAGIC+rlp(auth.chain_id, auth.address, auth.nonce), auth.vrs) to get authority_address
EVM-->>State: authority_address
State->>State: mark_address_warm(authority_address)
State->>State: code = get_code(authority_address)
alt code is empty or delegation designation AND nonce matches
State->>State: refund += PER_EMPTY_ACCOUNT_BASE_COST - PER_AUTH_BASE_COST (if account exists)
State->>State: set_code(authority_address, DELEGATION_DESIGNATION_PREFIX + auth.address)
State->>State: increment_nonce(authority_address)
else Invalid Authorization
State->>State: Continue to next auth
end
end
State-->>Executor: message_refund (including auth_refunds)
Sequence Diagram: EVM Call Operation with Code Delegation (EIP-7702)sequenceDiagram
participant Caller as Calling Contract / EOA
participant EVM as EVM Execution
participant State as PragueState
participant TargetContract as Target Contract Code
participant DelegationContract as Delegated Contract Code
Caller->>EVM: Initiates CALL/DELEGATECALL/STATICCALL/CALLCODE
EVM->>EVM: Opcode (e.g., CallEIP7702) execution
EVM->>State: get_code_at_address(code_source_address)
activate State
State->>State: real_code = get_code(code_source_address)
alt real_code is Delegation Designation (e.g., EF0100 + delegation_addr)
State->>State: delegation_address = extract_address(real_code)
State->>State: mark_address_warm(delegation_address)
State->>State: final_code = get_code(delegation_address)
State-->>EVM: (final_code, delegation_address)
else Not a Delegation
State-->>EVM: (real_code, null)
end
deactivate State
EVM->>EVM: Prepare child message (msg)
EVM->>EVM: msg.is_delegation = (delegation_address is not null)
EVM->>EVM: msg.code = final_code
EVM->>EVM: msg.code_address = delegation_address or code_source_address
alt Precompile Call AND msg.is_delegation is true
EVM->>EVM: Skip precompile execution
EVM-->>Caller: Return (e.g., error or specific result)
else Regular Call or Non-Delegated Precompile
EVM->>TargetContract/DelegationContract: Execute child computation with msg
TargetContract/DelegationContract-->>EVM: Result
EVM-->>Caller: Return result
end
Sequence Diagram: PragueVM Block Post-Processing (Requests Hash)sequenceDiagram
participant BlockBuilder
participant PragueVM
participant State as PragueState
participant DepositContract
participant WithdrawalPredeploy
participant ConsolidationPredeploy
BlockBuilder->>PragueVM: mine_block(filled_block)
PragueVM->>PragueVM: block_postprocessing(filled_block)
activate PragueVM
PragueVM->>PragueVM: process_deposit_request_data(block)
PragueVM->>State: Iterate block.receipts for deposit events
State-->>PragueVM: Deposit log data
PragueVM->>PragueVM: block.block_requests.append(DEPOSIT_REQUEST_TYPE + data)
PragueVM->>PragueVM: process_withdrawal_request_data(block)
PragueVM->>State: get_code(WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS)
State-->>PragueVM: withdrawal_contract_code
opt withdrawal_contract_code exists
PragueVM->>WithdrawalPredeploy: execute_bytecode(...)
WithdrawalPredeploy-->>PragueVM: withdrawal_computation.output
PragueVM->>PragueVM: block.block_requests.append(WITHDRAWAL_REQUEST_TYPE + output)
end
PragueVM->>PragueVM: process_consolidation_request_data(block)
PragueVM->>State: get_code(CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS)
State-->>PragueVM: consolidation_contract_code
opt consolidation_contract_code exists
PragueVM->>ConsolidationPredeploy: execute_bytecode(...)
ConsolidationPredeploy-->>PragueVM: consolidation_computation.output
PragueVM->>PragueVM: block.block_requests.append(CONSOLIDATION_REQUEST_TYPE + output)
end
PragueVM->>PragueVM: compute_requests_hash(block)
PragueVM->>PragueVM: header = block.header.copy(requests_hash=sha256(all_requests))
PragueVM->>PragueVM: processed_block = block.copy(header=header)
PragueVM-->>BlockBuilder: return processed_block
deactivate PragueVM
ER Diagram: Core Data Model Changes in Prague ForkerDiagram
TRANSACTION_FIELDS_API {
sequence_SetCodeAuthorizationAPI_ authorization_list "new"
}
SET_CODE_AUTHORIZATION_API {
int chain_id
Address address
int nonce
int y_parity
int r
int s
}
TRANSACTION_FIELDS_API ||--o{ SET_CODE_AUTHORIZATION_API : "has 0..* (via authorization_list)"
AUTHORIZATION {
int chain_id
Address address
int nonce
int y_parity
int r
int s
}
AUTHORIZATION }|..|| SET_CODE_AUTHORIZATION_API : "implements"
SET_CODE_TRANSACTION {
int chain_id
int nonce
int max_priority_fee_per_gas
int max_fee_per_gas
int gas
Address to
int value
bytes data
sequence_AccountAccesses_ access_list
sequence_Authorization_ authorization_list "new"
int y_parity
int r
int s
}
SET_CODE_TRANSACTION ||--o{ AUTHORIZATION : "contains"
BLOCK_API {
list_bytes_ block_requests "new"
}
PRAGUE_BLOCK_HEADER {
Hash32 requests_hash "new"
}
BLOCK_API ||--|{ PRAGUE_BLOCK_HEADER : "has a"
MESSAGE_API {
bool is_delegation "new"
int refund "new"
}
COMPUTATION_API {
int data_floor_gas "new"
}
TRANSACTION_CONTEXT_API {
sequence_SetCodeAuthorizationAPI_ authorization_list "new, optional"
}
Class Diagram: Prague EIP-7702 Transaction StructuresclassDiagram
direction LR
class SetCodeAuthorizationAPI {
<<Interface>>
+chain_id int
+address Address
+nonce int
+y_parity int
+r int
+s int
+validate_for_transaction() None
+validate(chain_id int) None
}
class Authorization {
<<RLPSerializable>>
+chain_id int
+address Address
+nonce int
+y_parity int
+r int
+s int
}
Authorization ..|> SetCodeAuthorizationAPI : implements
class TransactionFieldsAPI {
<<Interface>>
+max_fee_per_blob_gas int
+blob_versioned_hashes Sequence~Hash32~
+authorization_list Sequence~SetCodeAuthorizationAPI~
}
class UnsignedSetCodeTransaction {
<<RLPSerializable>>
+chain_id int
+nonce int
+max_priority_fee_per_gas int
+max_fee_per_gas int
+gas int
+to Address
+value int
+data bytes
+access_list Sequence
+authorization_list Sequence~Authorization~
+as_signed_transaction(private_key PrivateKey) TypedTransaction
}
UnsignedSetCodeTransaction -- TransactionFieldsAPI : (implicitly uses fields)
UnsignedSetCodeTransaction "1" *-- "0..*" Authorization : contains
class SetCodeTransaction {
<<RLPSerializable>>
+chain_id int
+nonce int
+max_priority_fee_per_gas int
+max_fee_per_gas int
+gas int
+to Address
+value int
+data bytes
+access_list Sequence
+authorization_list Sequence~Authorization~
+y_parity int
+r int
+s int
}
SetCodeTransaction -- TransactionFieldsAPI : (implicitly uses fields)
SetCodeTransaction "1" *-- "0..*" Authorization : contains
class PragueTypedTransaction {
+decoders Dict
+receipt_builder PragueReceiptBuilder
+_inner SignedTransactionAPI
}
PragueTypedTransaction o-- SetCodeTransaction : wraps
class PragueTransactionBuilder {
+legacy_signed PragueLegacyTransaction
+legacy_unsigned PragueUnsignedLegacyTransaction
+typed_transaction PragueTypedTransaction
+new_unsigned_set_code_transaction(...) UnsignedSetCodeTransaction
+new_set_code_transaction(...) PragueTypedTransaction
}
PragueTransactionBuilder ..> UnsignedSetCodeTransaction : creates
PragueTransactionBuilder ..> SetCodeTransaction : creates
PragueTransactionBuilder ..> PragueTypedTransaction : creates
Class Diagram: Prague Block and Header StructuresclassDiagram
class BlockAPI {
<<Interface>>
+header BlockHeaderAPI
+transactions Sequence~SignedTransactionAPI~
+uncles Sequence~BlockHeaderAPI~
+withdrawals Sequence~WithdrawalAPI~
+block_requests List~bytes~
}
class CancunBlock {
header CancunBlockHeader
}
class PragueBlock {
header PragueBlockHeader
transaction_builder PragueTransactionBuilder
receipt_builder PragueReceiptBuilder
+block_requests List~bytes~
}
PragueBlock --|> CancunBlock
PragueBlock ..|> BlockAPI
class BlockHeaderAPI {
<<Interface>>
+parent_beacon_block_root Hash32
+requests_hash Hash32
}
class CancunBlockHeader {
parent_beacon_block_root Hash32
}
class PragueBlockHeader {
requests_hash Hash32
}
PragueBlockHeader --|> CancunBlockHeader
PragueBlockHeader ..|> BlockHeaderAPI
PragueBlock *-- "1" PragueBlockHeader : contains
PragueBlock *-- "0..*" PragueTransactionBuilder : uses transactions from
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Head branch was pushed to by a user without write access
Removed Discord and build status badges from README.
Dargon789
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: Bump version: 0.12.0-beta.3 → 0.12.1-beta.1 #4
Dargon789
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: Bump version: 0.12.0-beta.3 → 0.12.1-beta.1 #4
What was wrong?
Related to Issue #
Closes #
How was it fixed?
Todo:
Cute Animal Picture
Summary by Sourcery
Implement the Prague network upgrade and bump package version to 0.12.1-beta.1
New Features:
Enhancements:
CI:
Documentation:
Tests:
Chores: