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: Add metadata field on the certificate #151

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

goran-ethernal
Copy link
Collaborator

Description

Metadata field

This PR adds a Metadata field to certificate. This field is a Hash field, that different chains can use to store arbitrary data relevant to them. In our case, we store the the number of block on L2 until which we built the given certificate.

For example, we built a certificate for blocks 10 to 20 on L2. We will store number 20 in a form of hash to the Metadata field on the certificate.

Once the agglayer team introduces the rpc endpoint to get the last sent certificate by our network, we can use that field to know from which block to build the next certificate. For now, we use a local database on the aggsender for this, but we want to avoid cases where we might lose our local db, or it gets corrupted, or we missed a lot of blocks.

Invalid signer issue

This PR also fixes the issue of signing a wrong certificate hash, which caused the InvalidSigner problem on the agglayer.
agglayer signs the same data as in HashToSign function.

Global index on imported bridge exits is first converted to little endian slice, and then hashed, as per agglayer code.

@goran-ethernal goran-ethernal added the enhancement New feature or request label Oct 31, 2024
@goran-ethernal goran-ethernal self-assigned this Oct 31, 2024
common/common_test.go Outdated Show resolved Hide resolved
common/common.go Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Oct 31, 2024

@goran-ethernal goran-ethernal merged commit 7a84588 into develop Oct 31, 2024
10 checks passed
@goran-ethernal goran-ethernal deleted the feat/metadata-field-on-certificate branch October 31, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aggsender enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants