You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assertlen(cell_indices) ==len(cells), f"Cell Indices list (detected length {len(cell_indices)}) and Cell list (detected length {len(cells)}) should have same length."# noqa: E501
recovered_cells, recovered_proofs=ckzg.recover_cells_and_kzg_proofs(remaining_indices, remaining_cells, ts) # on success returns two lists of len 128 # noqa: E501
88
+
recovered_cells, recovered_proofs=ckzg.recover_cells_and_kzg_proofs(remaining_indices, remaining_cells, TRUSTED_SETUP) # on success returns two lists of len 128 # noqa: E501
132
89
133
90
# determine success/failure
134
91
assertlen(recovered_cells) ==len(cells), f"Failed to recover cell list. Original cell list had length {len(cells)} but recovered cell list has length {len(recovered_cells)}"# noqa: E501
135
92
assertlen(recovered_proofs) ==len(proofs), f"Failed to recover proofs list. Original proofs list had length {len(proofs)} but recovered proofs list has length {len(recovered_proofs)}"# noqa: E501
136
93
137
94
foriinrange(len(recovered_cells)):
138
-
assertcells[i] ==recovered_cells[i], f"Failed to correctly restore missing cells. At index {i} original cell was {cells[i]} but reconstructed cell does not match: {recovered_cells[i]}"# noqa: E501
139
-
assertproofs[i] ==recovered_proofs[i], f"Failed to correctly restore missing proofs. At index {i} original proof was {proofs[i]} but reconstructed proof does not match: {recovered_proofs[i]}"# noqa: E501
95
+
assertcells[i] ==recovered_cells[i], f"Failed to correctly restore missing cells. At index {i} original cell was 0x{cells[i].hex()} but reconstructed cell does not match: 0x{recovered_cells[i].hex()}"# noqa: E501
96
+
assertproofs[i] ==recovered_proofs[i], f"Failed to correctly restore missing proofs. At index {i} original proof was 0x{proofs[i].hex()} but reconstructed proof does not match: 0x{recovered_proofs[i].hex()}"# noqa: E501
140
97
141
98
# print("Successful reconstruction")
142
99
143
100
classPersistentBlobGenerator:
144
-
# PersistentBlobGenerator("4a") creates blob_4a.json in cwd and contains blob, commitment, cells and proofs
101
+
"""PersistentBlobGenerator takes an rng seed and returns a valid blob deterministically derived from it."""# noqa: E501
102
+
103
+
# e.g. PersistentBlobGenerator(42) creates blob_42.json in cwd and contains blob, commitment, cells and proofs. 42 stands for the rng seed used # noqa: E501
BLS_MODULUS=0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001# EIP-2537: Main subgroup order = q # noqa: E501
29
+
# due to BLS_MODULUS every blob byte (uint256) must be smaller than 116
30
+
31
+
# deneb constants that have not changed (https://github.com/ethereum/consensus-specs/blob/cc6996c22692d70e41b7a453d925172ee4b719ad/specs/deneb/polynomial-commitments.md?plain=1#L78)
0 commit comments