Skip to content

Include new contract data function tree root in tx hash#188

Merged
spalladino merged 12 commits intomasterfrom
palla/tx-hash-with-fn-tree-root
Apr 10, 2023
Merged

Include new contract data function tree root in tx hash#188
spalladino merged 12 commits intomasterfrom
palla/tx-hash-with-fn-tree-root

Conversation

@spalladino
Copy link
Copy Markdown
Contributor

@spalladino spalladino commented Apr 5, 2023

  • Refactors wasm wrappers in bb and circuits
  • Introduces new primitives wasm wrapper (using bb wasm for now)
  • Uses calculateContractLeaf for calculating contract tree commitments used for the tx hash
  • Makes txHash tx getter async (sorry)

Note that, since we now depend on circuits for explicitly calculating contract leaves via the computeContractLeaf cbind, the primitives wasm is left unused. I'm leaving it as part of the PR since we can leverage it in the future for more lightweight dependencies, but I wouldn't worry about this atm.

Depends on AztecProtocol/aztec3-circuits#178

Fixes #154

@spalladino spalladino force-pushed the palla/tx-hash-with-fn-tree-root branch 4 times, most recently from 4ae9246 to 65ea927 Compare April 10, 2023 11:23
@spalladino spalladino force-pushed the palla/tx-hash-with-fn-tree-root branch from ba5780a to 356689a Compare April 10, 2023 13:31
@spalladino spalladino requested a review from ludamad April 10, 2023 13:55
@spalladino spalladino marked this pull request as ready for review April 10, 2023 13:55
import { BarretenbergWasm } from '../../wasm/index.js';
import { WasmWrapper } from '@aztec/foundation/wasm';

export class Grumpkin {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not the biggest fan of the Wrapper name, the intent was that the generic concept was called WasmModule

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Almost any utility class could be called a Wrapper, is my reasoning, but it represents what it wraps

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree, and WasmModule was also my first choice for a name, but there's already a lower level WasmModule in the repo.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah I created that one, it was meant to provide everything needed to just pass around without introducing base classes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suppose that's not quite right though with async call state

COPY l2-block l2-block
COPY tx tx
COPY unverified-data unverified-data
COPY . .
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1 if we're going to have a dependency system no reason to copy dependencies one by one (which mostly can help with docker figuring out its own dependencies)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

@ludamad ludamad left a comment

Choose a reason for hiding this comment

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

LGTM other than naming comment

@spalladino
Copy link
Copy Markdown
Contributor Author

I cannot come up with a better name for now. I'll merge and keep thinking about it.

@spalladino spalladino merged commit 86851ec into master Apr 10, 2023
@spalladino spalladino deleted the palla/tx-hash-with-fn-tree-root branch April 10, 2023 14:33
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.

Include functionTreeRoot of new contracts when calculating tx hash

2 participants