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

Migrate transactions to merkle_patricia_proofs library #306

Merged
merged 5 commits into from
May 24, 2024

Conversation

Pasifaee
Copy link
Contributor

No description provided.

@Pasifaee Pasifaee marked this pull request as ready for review May 23, 2024 13:22
Copy link
Collaborator

@LogvinovLeon LogvinovLeon left a comment

Choose a reason for hiding this comment

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

Yay!

ethereum/oracles/src/noir/oracles/common/proofConfig.ts Outdated Show resolved Hide resolved
ethereum/circuits/lib/src/serde.nr Show resolved Hide resolved
@@ -165,6 +165,7 @@ impl Serde<RECEIPT_PROOF_LEN_M> for Proof<RECEIPT_MAX_DEPTH_NO_LEAF, RECEIPT_MAX
}

global RECEIPT_PROOF_INPUT_LEN_M = RECEIPT_MAX_PREFIXED_KEY_NIBBLE_LEN + RECEIPT_MAX_VALUE_LEN_M + RECEIPT_PROOF_LEN_M;
global TX_PROOF_INPUT_LEN_M = RECEIPT_PROOF_INPUT_LEN_M;

impl Serde<RECEIPT_PROOF_INPUT_LEN_M> for ProofInput<RECEIPT_MAX_PREFIXED_KEY_NIBBLE_LEN, RECEIPT_MAX_VALUE_LEN_M, RECEIPT_MAX_DEPTH_NO_LEAF, RECEIPT_MAX_LEAF_LEN_M> {
fn serialize(self) -> [Field; RECEIPT_PROOF_INPUT_LEN_M] {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be also clearer if we used a common length here instead of receipt.

ethereum/circuits/lib/src/transaction.nr Show resolved Hide resolved

const proofInputKeyPart = txWithProof[OFFSETS.PROOF_INPUT].slice(0, txProofConfigM.maxPrefixedKeyNibbleLen);
const paddedKey = padArray(['0x08'], txProofConfigM.maxPrefixedKeyNibbleLen, ZERO_PAD_VALUE, 'left');
expect(proofInputKeyPart).toStrictEqual(paddedKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't we losing here some testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I will add tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

Merged via the queue into main with commit d7eb9a3 May 24, 2024
6 checks passed
@Pasifaee Pasifaee deleted the iza/tx_migration branch May 24, 2024 11:42
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.

3 participants