Skip to content

Commit

Permalink
Move FIELD_ELEMENTS_PER_EXT_BLOB to cell.h
Browse files Browse the repository at this point in the history
Also add new EXPANSION_FACTOR constant.
  • Loading branch information
jtraglia committed Sep 18, 2024
1 parent 87068fb commit 7cf99f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bindings/rust/src/bindings/generated.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/eip4844/blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
/** The number of field elements in a blob. */
#define FIELD_ELEMENTS_PER_BLOB 4096

/** The number of field elements in an extended blob */
#define FIELD_ELEMENTS_PER_EXT_BLOB (FIELD_ELEMENTS_PER_BLOB * 2)

/** The number of bytes in a blob. */
#define BYTES_PER_BLOB (FIELD_ELEMENTS_PER_BLOB * BYTES_PER_FIELD_ELEMENT)

Expand Down
6 changes: 6 additions & 0 deletions src/eip7594/cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
/** The number of bytes in a single cell. */
#define BYTES_PER_CELL (FIELD_ELEMENTS_PER_CELL * BYTES_PER_FIELD_ELEMENT)

/** The Reed-Solomon erasuring coding expansion factor. */
#define EXPANSION_FACTOR 2

/** The number of field elements in an extended blob */
#define FIELD_ELEMENTS_PER_EXT_BLOB (FIELD_ELEMENTS_PER_BLOB * EXPANSION_FACTOR)

/** The number of cells in an extended blob. */
#define CELLS_PER_EXT_BLOB (FIELD_ELEMENTS_PER_EXT_BLOB / FIELD_ELEMENTS_PER_CELL)

Expand Down

0 comments on commit 7cf99f2

Please sign in to comment.