Skip to content

Commit 4bf0f25

Browse files
committed
improved some comments
1 parent f057375 commit 4bf0f25

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/ethereum_test_types/blob_types.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ class Blob(CamelModel):
5454
data: Bytes
5555
commitment: Bytes
5656
proof: List[Bytes] | Bytes # Bytes < Osaka, List[Bytes] >= Osaka
57-
cells: List[Bytes] | None # None (in json: null) < Osaka, List[Bytes] >= Osaka
57+
cells: List[Bytes] | None # None (in json: null) < Osaka, List[Bytes] >= Osaka
5858

5959
versioned_hash: Hash
60-
name: str # blob_<fork>_<seed>
60+
name: str
6161
fork: Fork
6262
seed: int
63-
timestamp: int
63+
timestamp: int # fork transitions require timestamp >= 15000 to occur
6464

6565
_trusted_setup: ClassVar[Any | None] = None
6666

@@ -149,7 +149,7 @@ def get_commitment(data: Bytes) -> Bytes:
149149
"""
150150
Take a blob and returns a cryptographic commitment to it.
151151
152-
Note: Each cell seems to hold a copy of this commitment.
152+
Note: Each cell holds the exact same copy of this commitment.
153153
"""
154154
# sanity check
155155
field_elements: int = cast(int, fork.get_blob_constant("FIELD_ELEMENTS_PER_BLOB"))
@@ -181,7 +181,7 @@ def get_proof(fork: Fork, data: Bytes) -> List[Bytes] | Bytes:
181181
proof, _ = ckzg.compute_kzg_proof(data, z_valid_size, Blob._trusted_setup)
182182
return proof
183183

184-
# osaka
184+
# >=osaka
185185
if amount_cell_proofs == 128:
186186
_, proofs = ckzg.compute_cells_and_kzg_proofs(
187187
data, Blob._trusted_setup
@@ -201,7 +201,7 @@ def get_cells(fork: Fork, data: Bytes) -> List[Bytes] | None:
201201
if amount_cell_proofs == 0:
202202
return None
203203

204-
# osaka
204+
# >=osaka
205205
if amount_cell_proofs == 128:
206206
cells, _ = ckzg.compute_cells_and_kzg_proofs(
207207
data, Blob._trusted_setup
@@ -406,12 +406,10 @@ def corrupt_byte(b: bytes) -> Bytes:
406406
raise ValueError("Input must be a single byte")
407407
return Bytes(bytes([b[0] ^ 0xFF]))
408408

409-
# osaka and later
409+
# >=osaka
410410
amount_cell_proofs: int = cast(int, self.fork.get_blob_constant("AMOUNT_CELL_PROOFS"))
411411
if amount_cell_proofs > 0:
412-
assert isinstance(self.proof, list), (
413-
"proof was expected to be a list but it isn't"
414-
) # make mypy happy
412+
assert isinstance(self.proof, list), "proof was expected to be a list but it isn't"
415413

416414
if mode == self.ProofCorruptionMode.CORRUPT_FIRST_BYTE:
417415
for i in range(len(self.proof)):

0 commit comments

Comments
 (0)