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

Change Transaction nonce to U64 #995

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ethereum/arrow_glacier/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LegacyTransaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -52,7 +52,7 @@ class AccessListTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -72,7 +72,7 @@ class FeeMarketTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
max_priority_fee_per_gas: Uint
max_fee_per_gas: Uint
gas: Uint
Expand Down Expand Up @@ -146,7 +146,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
6 changes: 3 additions & 3 deletions src/ethereum/berlin/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LegacyTransaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -52,7 +52,7 @@ class AccessListTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand Down Expand Up @@ -118,7 +118,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/byzantium/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Transaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand Down Expand Up @@ -68,7 +68,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
10 changes: 5 additions & 5 deletions src/ethereum/cancun/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LegacyTransaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -52,7 +52,7 @@ class AccessListTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -72,7 +72,7 @@ class FeeMarketTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
max_priority_fee_per_gas: Uint
max_fee_per_gas: Uint
gas: Uint
Expand All @@ -93,7 +93,7 @@ class BlobTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
max_priority_fee_per_gas: Uint
max_fee_per_gas: Uint
gas: Uint
Expand Down Expand Up @@ -178,7 +178,7 @@ def validate_transaction(tx: Transaction) -> bool:

if calculate_intrinsic_cost(tx) > tx.gas:
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
if tx.to == Bytes0(b"") and len(tx.data) > 2 * MAX_CODE_SIZE:
return False
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/constantinople/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Transaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand Down Expand Up @@ -68,7 +68,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/dao_fork/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Transaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand Down Expand Up @@ -68,7 +68,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/frontier/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Transaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand Down Expand Up @@ -67,7 +67,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
8 changes: 4 additions & 4 deletions src/ethereum/gray_glacier/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LegacyTransaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -52,7 +52,7 @@ class AccessListTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -72,7 +72,7 @@ class FeeMarketTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
max_priority_fee_per_gas: Uint
max_fee_per_gas: Uint
gas: Uint
Expand Down Expand Up @@ -146,7 +146,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/homestead/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Transaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand Down Expand Up @@ -68,7 +68,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/istanbul/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Transaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand Down Expand Up @@ -68,7 +68,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
8 changes: 4 additions & 4 deletions src/ethereum/london/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LegacyTransaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -52,7 +52,7 @@ class AccessListTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -72,7 +72,7 @@ class FeeMarketTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
max_priority_fee_per_gas: Uint
max_fee_per_gas: Uint
gas: Uint
Expand Down Expand Up @@ -146,7 +146,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/muir_glacier/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Transaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand Down Expand Up @@ -68,7 +68,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
8 changes: 4 additions & 4 deletions src/ethereum/paris/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LegacyTransaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -52,7 +52,7 @@ class AccessListTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -72,7 +72,7 @@ class FeeMarketTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
max_priority_fee_per_gas: Uint
max_fee_per_gas: Uint
gas: Uint
Expand Down Expand Up @@ -146,7 +146,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > tx.gas:
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
8 changes: 4 additions & 4 deletions src/ethereum/shanghai/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LegacyTransaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -52,7 +52,7 @@ class AccessListTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand All @@ -72,7 +72,7 @@ class FeeMarketTransaction:
"""

chain_id: U64
nonce: U256
nonce: U64
max_priority_fee_per_gas: Uint
max_fee_per_gas: Uint
gas: Uint
Expand Down Expand Up @@ -148,7 +148,7 @@ def validate_transaction(tx: Transaction) -> bool:

if calculate_intrinsic_cost(tx) > tx.gas:
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
if tx.to == Bytes0(b"") and len(tx.data) > 2 * MAX_CODE_SIZE:
return False
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/spurious_dragon/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Transaction:
Atomic operation performed on the block chain.
"""

nonce: U256
nonce: U64
gas_price: Uint
gas: Uint
to: Union[Bytes0, Address]
Expand Down Expand Up @@ -68,7 +68,7 @@ def validate_transaction(tx: Transaction) -> bool:
"""
if calculate_intrinsic_cost(tx) > Uint(tx.gas):
return False
if tx.nonce >= U256(U64.MAX_VALUE):
if tx.nonce >= U64.MAX_VALUE:
return False
return True

Expand Down
Loading
Loading