Skip to content

Conversation

@IlyasRidhuan
Copy link
Contributor

@IlyasRidhuan IlyasRidhuan commented Sep 11, 2025

PR changes the approach for handling protocol contracts in the AVM.

Introduces a ProtocolContractSetInterface that manages the static (per rollup deployment) set of protocol contract's derived addresses. The current implementation of this set is as an indexed merkle tree - although hopefully we are able to migrate to a simpler (non-indexed tree) structure.

When retrieving the derived address for a protocol contract, we also produce a merkle membership path that is checked against the L1 public contracts tree root (currently unconstrained). This will eventually be included in the public inputs of the AVM. There is a new corresponding subtrace for the protocol contracts derived address retrieval

The map of canonical address to derived address is hinted via TS as part of AvmExecutionHints

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@IlyasRidhuan IlyasRidhuan changed the title fix(avm)!: disable address derivation feat(avm)!: protocol contracts Sep 11, 2025
@IlyasRidhuan IlyasRidhuan force-pushed the ir/avm-protocol-contracts branch 2 times, most recently from 456e151 to 39a42f9 Compare September 11, 2025 11:23
@IlyasRidhuan IlyasRidhuan force-pushed the ir/avm-protocol-contracts branch from 39a42f9 to b81188f Compare September 11, 2025 13:08
Copy link
Contributor

@dbanks12 dbanks12 left a comment

Choose a reason for hiding this comment

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

Overall looking good once others' concerns are addressed

@IlyasRidhuan IlyasRidhuan force-pushed the ir/avm-protocol-contracts branch 2 times, most recently from cf0917e to 498f6c9 Compare September 12, 2025 09:13
@IlyasRidhuan IlyasRidhuan force-pushed the ir/avm-protocol-contracts branch from 498f6c9 to 4e4f4ce Compare September 12, 2025 11:29
@IlyasRidhuan IlyasRidhuan force-pushed the ir/avm-protocol-contracts branch from 4e4f4ce to f36563d Compare September 12, 2025 12:56
@IlyasRidhuan IlyasRidhuan removed the request for review from LeilaWang September 12, 2025 15:06
@IlyasRidhuan IlyasRidhuan force-pushed the ir/avm-protocol-contracts branch 2 times, most recently from fbb4bfc to 5e7e9eb Compare September 12, 2025 17:38
Copy link
Contributor

@sirasistant sirasistant left a comment

Choose a reason for hiding this comment

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

Looks good on my side

@IlyasRidhuan IlyasRidhuan force-pushed the ir/avm-protocol-contracts branch from 5e7e9eb to 6f7b4ad Compare September 15, 2025 11:28
@IlyasRidhuan IlyasRidhuan merged commit 3d8f226 into merge-train/avm Sep 16, 2025
7 checks passed
@IlyasRidhuan IlyasRidhuan deleted the ir/avm-protocol-contracts branch September 16, 2025 06:32
@AztecBot AztecBot mentioned this pull request Sep 16, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 16, 2025
BEGIN_COMMIT_OVERRIDE
chore(avm): always print bulk bench metrics
chore: betas optimization - 2^d multiplications (#16963)
docs: Add migration notes for gas costs (#16925)
feat(avm)!: protocol contracts (#16949)
END_COMMIT_OVERRIDE
mralj pushed a commit that referenced this pull request Oct 13, 2025
PR changes the approach for handling protocol contracts in the AVM.

Introduces a `ProtocolContractSetInterface` that manages the static (per
rollup deployment) set of protocol contract's derived addresses. The
current implementation of this set is as an indexed merkle tree -
although hopefully we are able to migrate to a simpler (non-indexed
tree) structure.

When retrieving the derived address for a protocol contract, we also
produce a merkle membership path that is checked against the L1 public
contracts tree root (currently unconstrained). This will eventually be
included in the public inputs of the AVM. There is a new corresponding
subtrace for the protocol contracts derived address retrieval

The map of canonical address to derived address is hinted via TS as part
of `AvmExecutionHints`
ludamad pushed a commit that referenced this pull request Dec 16, 2025
PR changes the approach for handling protocol contracts in the AVM.

Introduces a `ProtocolContractSetInterface` that manages the static (per
rollup deployment) set of protocol contract's derived addresses. The
current implementation of this set is as an indexed merkle tree -
although hopefully we are able to migrate to a simpler (non-indexed
tree) structure.

When retrieving the derived address for a protocol contract, we also
produce a merkle membership path that is checked against the L1 public
contracts tree root (currently unconstrained). This will eventually be
included in the public inputs of the AVM. There is a new corresponding
subtrace for the protocol contracts derived address retrieval

The map of canonical address to derived address is hinted via TS as part
of `AvmExecutionHints`
ludamad pushed a commit that referenced this pull request Dec 16, 2025
PR changes the approach for handling protocol contracts in the AVM.

Introduces a `ProtocolContractSetInterface` that manages the static (per
rollup deployment) set of protocol contract's derived addresses. The
current implementation of this set is as an indexed merkle tree -
although hopefully we are able to migrate to a simpler (non-indexed
tree) structure.

When retrieving the derived address for a protocol contract, we also
produce a merkle membership path that is checked against the L1 public
contracts tree root (currently unconstrained). This will eventually be
included in the public inputs of the AVM. There is a new corresponding
subtrace for the protocol contracts derived address retrieval

The map of canonical address to derived address is hinted via TS as part
of `AvmExecutionHints`
ludamad pushed a commit that referenced this pull request Dec 16, 2025
PR changes the approach for handling protocol contracts in the AVM.

Introduces a `ProtocolContractSetInterface` that manages the static (per
rollup deployment) set of protocol contract's derived addresses. The
current implementation of this set is as an indexed merkle tree -
although hopefully we are able to migrate to a simpler (non-indexed
tree) structure.

When retrieving the derived address for a protocol contract, we also
produce a merkle membership path that is checked against the L1 public
contracts tree root (currently unconstrained). This will eventually be
included in the public inputs of the AVM. There is a new corresponding
subtrace for the protocol contracts derived address retrieval

The map of canonical address to derived address is hinted via TS as part
of `AvmExecutionHints`
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.

5 participants