-
Notifications
You must be signed in to change notification settings - Fork 305
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(SimulateTx): Decoded Return values for public and private function calls #5551
Conversation
Co-authored-by: esau <152162806+sklppy88@users.noreply.github.com>
Docs PreviewHey there! 👋 You can check your preview at https://660d6bf24d6f1ffc9e9d9ad7--aztec-docs-dev.netlify.app |
Benchmark resultsMetrics with a significant change:
Detailed resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Values are compared against data from master at commit L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 16 txs.
Circuits statsStats on running time and I/O sizes collected for every circuit run across all benchmarks.
Tree insertion statsThe duration to insert a fixed batch of leaves into each tree type.
MiscellaneousTransaction sizes based on how many contract classes are registered in the tx.
Transaction size based on fee payment method
Transaction processing duration by data writes.
|
Leverages the `#[abi(tag)]` feature from AztecProtocol/aztec-packages#5386 to output the aztec functions abi *before* macro transformation, so that values can be decoded in AztecProtocol/aztec-packages#5551 --------- Co-authored-by: esau <152162806+sklppy88@users.noreply.github.com>
Closing this as I created the cleaner version of it in #5762 now that other things were merged it, seemed easier than cleaning this abomination. |
Went into a bit of merging hell here, so only the last commit is really the important one that have the diffs for this pr - eb46d88.
The pr changes slightly how the artifact is used to construct the
FunctionArtifact
as part of thecontract_artifact.ts
such that it includes the returnTypes from BEFORE the macros have been applied. This is possible using @Thunkar's additions to the abi 😎.The private and public execution is altered to return the flattened values directly, and the
simulate
in thecontract_function_interaction.ts
will then use the changes to the artifact to decode the values before returning to the user.Compared to the old approach where I was looking to return decoded from the simulation, this is more straightforward as we don't need to handle additional plumbing to get the artifacts into the public execution, and keeps the decoding on the user side of things. Also makes it easier to follow the paths.
The solution is currently only returning the return values of the last enqueued public call as part of the application logic.
This was done as it is: 1) unclear what is actually the expected, 2) there will only be one in most cases where using it as a read.
The main case where there could be multiple public calls that you want to get the return values for would be for using the multi-call structure, where we wish to get the return values for every single one. Making the multi-call work is still a TODO.
Note that something like a multicall can be implemented with just a single enqueued public call if done as a contract, so that can be done interim, but longer term it would be quite interesting to be able to use the batch directly without needing a multi-call contract to be deployed at all.
The native multi-calls are also an issue for the private functions. This solution is therefore mainly for having the ability to read without unconstrained, multi-calls can come later.