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

EIP-4844 #1

Draft
wants to merge 55 commits into
base: unstable
Choose a base branch
from
Draft

EIP-4844 #1

wants to merge 55 commits into from

Conversation

dgcoffman
Copy link
Owner

@dgcoffman dgcoffman commented Oct 17, 2022

Implements EIP-4844 in Lodestar.

As specified in the consensus specs, except where we are ahead of the spec:

See also ethereum/consensus-specs#3043

TODO

See also

@@ -136,7 +136,7 @@ describe("LevelDB controller", () => {

function getDbSize(): number {
// 116 ./.__testdb
const res = execSync(`du -bs ${dbLocation}`, {encoding: "utf8"});
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-b doesn't exist on OSX's du

@dgcoffman dgcoffman mentioned this pull request Oct 18, 2022
3 tasks
@dgcoffman dgcoffman force-pushed the dgc/eip-4844 branch 2 times, most recently from df8ff46 to 4f8602d Compare October 28, 2022 19:13
@@ -38,7 +38,7 @@ export const phase0: Phase0Preset = {
// 2**0 (= 1) slots 6 seconds
MIN_ATTESTATION_INCLUSION_DELAY: 1,
// [customized] fast epochs
SLOTS_PER_EPOCH: 8,
SLOTS_PER_EPOCH: 3,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -27,7 +28,7 @@ export function validateBlobsAndKzgCommitments(
// assert [blob_to_kzg_commitment(blob) == commitment for blob, commitment in zip(blobs, blob_kzg_commitments)]
blobs.forEach((blob, index) => {
const computedCommitment = blobToKzgCommitment(blob);
if (computedCommitment !== blobKzgCommitments[index]) {
if (!typedArraysAreEqual(computedCommitment, blobKzgCommitments[index])) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed the equality check

}

// message_offset = 1 + uint32.decode_bytes(opaque_tx[1:5])
const messageOffset = 1 + new DataView(opaqueTx.slice(1, 5).buffer, 0).getUint32(0, true); // Should always be 70
Copy link

@dapplion dapplion Nov 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true, it will always be 70. But for blobVersionedHashOffset I'm not sure if it's always gonna be 283. A blob transaction will:

  • Always have a to address. According to the types it can be None
  • Always have empty data field
  • Always have empty access_list field

If the conditions above hold then it will always be 283

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants