Skip to content

Commit 96fed55

Browse files
gurukamathSamWilsn
authored andcommitted
Implement EIP-7934 (#1289)
1 parent c47b68f commit 96fed55

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ethereum/osaka/fork.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@
110110
"0x0000F90827F1C53a10cb7A02335B175320002935"
111111
)
112112
HISTORY_SERVE_WINDOW = 8192
113+
MAX_BLOCK_SIZE = 10_485_760
114+
SAFETY_MARGIN = 2_097_152
115+
MAX_RLP_BLOCK_SIZE = MAX_BLOCK_SIZE - SAFETY_MARGIN
113116

114117

115118
@dataclass
@@ -207,6 +210,9 @@ def state_transition(chain: BlockChain, block: Block) -> None:
207210
block :
208211
Block to apply to `chain`.
209212
"""
213+
if len(rlp.encode(block)) > MAX_RLP_BLOCK_SIZE:
214+
raise InvalidBlock("Block rlp size exceeds MAX_RLP_BLOCK_SIZE")
215+
210216
validate_header(chain, block.header)
211217
if block.ommers != ():
212218
raise InvalidBlock

0 commit comments

Comments
 (0)