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

feat: Eigen Blob ID in L1 #275

Merged
merged 9 commits into from
Sep 19, 2024
Merged

Conversation

gianbelinche
Copy link

@gianbelinche gianbelinche commented Sep 18, 2024

What ❔

This PR adds the blob id to be stored on L1 when a batch is committed
It also adds a script for retrieving them directly from L1.
To run it:

cd get_all_blobs
npm i
node getallblobs.js validatorTimelockAddress=<validatorTimelockAddress> commitBatchesSharedBridge_functionSelector=<commitBatchesSharedBridge_functionSelector>

This generates a blob_data.json file, where blobs and commitments are stored.

Check validatorTimelockAddress when running zk init
commitBatchesSharedBridge_functionSelector is usually 0x6edd4f12

Why ❔

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.


async function getTransactions() {
const latestBlock = await web3.eth.getBlockNumber();
const validatorTimelockAddress = "0xeacf0411de906bdd8f2576692486383797d06004";
Copy link
Member

Choose a reason for hiding this comment

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

please parameterize the validatorTimelockAddress and the commitBatchesSharedBridge_functionSelector

Copy link
Author

Choose a reason for hiding this comment

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

Done!


getTransactions();

//0x4ed3cbf1cf6e8738118f87e5060aee0817c6f18b Chain Admin
Copy link
Member

Choose a reason for hiding this comment

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

what is the purpose of these comments?

Copy link
Author

Choose a reason for hiding this comment

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

They are all the contracts that are called on L1, I think it is nice to leave them somewhere is case we need them in the future. That could go somewhere else tough

Copy link
Member

@juanbono juanbono left a comment

Choose a reason for hiding this comment

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

Please address the comments. Also can you add some docs about how to run it?

@gianbelinche gianbelinche changed the title Eigen Blob ID in L1 feat: Eigen Blob ID in L1 Sep 18, 2024
@gianbelinche
Copy link
Author

Please address the comments. Also can you add some docs about how to run it?

Done!

input.slice(10) // Remove the function selector (first 10 characters of the calldata)
);
commitment = hexToUtf8(decodedParams._newBatchesData[0].pubdataCommitments.slice(4));
console.log(`Decoded Commitment:`, commitment);
Copy link
Member

Choose a reason for hiding this comment

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

please save/print the blobs too.

@juan518munoz
Copy link

Had some issues running the mentioned procedure

  • node install failed -> instead I ran npm i
  • node getallblobs.js threw connection refused -> replaced web3``localhost instantiation with 127.0.0.1

I would recommend applying the second change.

@gianbelinche
Copy link
Author

Had some issues running the mentioned procedure

  • node install failed -> instead I ran npm i

Yeah, typo, its npm

@gianbelinche gianbelinche merged commit d3a95a0 into da-eigen-implementation Sep 19, 2024
9 of 34 checks passed
@gianbelinche gianbelinche deleted the da-blob-id-l1-new branch September 19, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants