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: TRM redesign #1936

Merged
merged 8 commits into from
Mar 27, 2025
Merged

feat: TRM redesign #1936

merged 8 commits into from
Mar 27, 2025

Conversation

letypequividelespoubelles
Copy link
Collaborator

No description provided.

Signed-off-by: F Bojarski <[email protected]>
@letypequividelespoubelles letypequividelespoubelles linked an issue Mar 21, 2025 that may be closed by this pull request
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a redesign of the TRM module, refactoring the way WCP calls are handled and integrating a new approach for TRM operations. Key changes include:

  • Introducing a new WcpCall class to encapsulate WCP instruction calls.
  • Refactoring the Trm and TrmOperation classes to leverage the new WcpCall API and update loop conditions.
  • Updating Hub to instantiate Trm with the required Wcp dependency.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
arithmetization/src/main/java/net/consensys/linea/zktracer/module/wcp/WcpCall.java New class implementing WCP instruction calls with helper methods.
arithmetization/src/main/java/net/consensys/linea/zktracer/module/trm/Trm.java Refactored TRM module to use final parameters and pass Wcp to operations.
arithmetization/src/main/java/net/consensys/linea/zktracer/module/trm/TrmOperation.java Updated TRM operation logic to create WcpCall entries and adapt the tracing loop.
arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java Updated instantiation of Trm to include the Wcp dependency.
Files not reviewed (1)
  • linea-constraints: Language not supported

Signed-off-by: F Bojarski <[email protected]>
Copy link
Collaborator

@DavePearce DavePearce left a comment

Choose a reason for hiding this comment

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

LGTM

private final Bytes arg2Lo;
private final boolean result;

public WcpCall(Wcp wcp, byte instruction, Bytes arg1, Bytes arg2) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we needed that method here as well https://github.com/Consensys/linea-tracer/blob/arith-dev/arithmetization/src/main/java/net/consensys/linea/zktracer/module/blockdata/BlockdataOperation.java#L264
Maybe we add a TODO to refacto and use that method after you merge 👌

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need it not only for blockdata, but almost all modules calling WCP, so euc, mmio, txndata, hub, mxp, shakira, blakemodexp, ecData, oob, blockhash, soon rlpTxn ...

@letypequividelespoubelles letypequividelespoubelles enabled auto-merge (squash) March 27, 2025 15:34
@letypequividelespoubelles letypequividelespoubelles merged commit ac64ba0 into arith-dev Mar 27, 2025
7 checks passed
@letypequividelespoubelles letypequividelespoubelles deleted the 1927-trm-redesign branch March 27, 2025 15:49
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.

TRM redesign
3 participants