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: Use gas estimation in aztecjs contract function interactions #6260

Merged
merged 4 commits into from
May 14, 2024

Conversation

spalladino
Copy link
Collaborator

@spalladino spalladino commented May 7, 2024

Adds an estimateGas flag to the send method of contract function interactions (defaulting to false for now) to run an initial simulate on the request to get the gas limits before actually sending the tx.

Base automatically changed from palla/report-gas-usage-per-phase to master May 8, 2024 15:31
@spalladino spalladino force-pushed the palla/use-gas-estimation-in-aztecjs branch from 09258ca to 27ac8c8 Compare May 8, 2024 15:32
@spalladino spalladino marked this pull request as ready for review May 10, 2024 22:54
@spalladino spalladino requested a review from just-mitch May 10, 2024 22:54
@spalladino spalladino force-pushed the palla/use-gas-estimation-in-aztecjs branch from 27ac8c8 to d75c8a7 Compare May 10, 2024 22:54
@@ -27,7 +27,7 @@ export abstract class BaseContractInteraction {
protected tx?: Tx;
protected txRequest?: TxExecutionRequest;

constructor(protected pxe: PXE) {}
constructor(protected wallet: Wallet) {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did we need to make this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just noted that all derived classes were requiring a Wallet and not a PXE, so I lifted that to the base class.

@spalladino spalladino force-pushed the palla/use-gas-estimation-in-aztecjs branch 7 times, most recently from 658f611 to dba3592 Compare May 14, 2024 12:16
@spalladino spalladino enabled auto-merge (squash) May 14, 2024 13:21
@spalladino spalladino force-pushed the palla/use-gas-estimation-in-aztecjs branch from 0b95ba5 to f2031e7 Compare May 14, 2024 14:46
@spalladino spalladino merged commit 18192ac into master May 14, 2024
91 checks passed
@spalladino spalladino deleted the palla/use-gas-estimation-in-aztecjs branch May 14, 2024 15:21
ludamad pushed a commit that referenced this pull request May 14, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.40.0</summary>

##
[0.40.0](aztec-package-v0.39.0...aztec-package-v0.40.0)
(2024-05-14)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.40.0</summary>

##
[0.40.0](barretenberg.js-v0.39.0...barretenberg.js-v0.40.0)
(2024-05-14)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-packages: 0.40.0</summary>

##
[0.40.0](aztec-packages-v0.39.0...aztec-packages-v0.40.0)
(2024-05-14)


### ⚠ BREAKING CHANGES

* debug logs for all
([#6392](#6392))

### Features

* Add wasmtime
([#6314](#6314))
([ea6ccdd](ea6ccdd))
* Debug logs for all
([#6392](#6392))
([10afa13](10afa13))
* Demonstrating use of nsk_app to check nullification
([#6362](#6362))
([ddf4461](ddf4461))
* Use gas estimation in aztecjs contract function interactions
([#6260](#6260))
([18192ac](18192ac))


### Miscellaneous

* Add more serialisation traits to protocol circuits
([#6385](#6385))
([97d5422](97d5422))
* **ci:** Bump timeout of prover-client-test
([#6394](#6394))
([d05cd07](d05cd07))
* Reenable bench summary
([#6211](#6211))
([713b243](713b243))
* **token-contract-tests:** Change intrinsic assertion messages
([#6386](#6386))
([aca81ae](aca81ae))
</details>

<details><summary>barretenberg: 0.40.0</summary>

##
[0.40.0](barretenberg-v0.39.0...barretenberg-v0.40.0)
(2024-05-14)


### ⚠ BREAKING CHANGES

* debug logs for all
([#6392](#6392))

### Features

* Debug logs for all
([#6392](#6392))
([10afa13](10afa13))


### Miscellaneous

* Add more serialisation traits to protocol circuits
([#6385](#6385))
([97d5422](97d5422))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
AztecBot added a commit to AztecProtocol/barretenberg that referenced this pull request May 15, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.40.0</summary>

##
[0.40.0](AztecProtocol/aztec-packages@aztec-package-v0.39.0...aztec-package-v0.40.0)
(2024-05-14)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.40.0</summary>

##
[0.40.0](AztecProtocol/aztec-packages@barretenberg.js-v0.39.0...barretenberg.js-v0.40.0)
(2024-05-14)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-packages: 0.40.0</summary>

##
[0.40.0](AztecProtocol/aztec-packages@aztec-packages-v0.39.0...aztec-packages-v0.40.0)
(2024-05-14)


### ⚠ BREAKING CHANGES

* debug logs for all
([#6392](AztecProtocol/aztec-packages#6392))

### Features

* Add wasmtime
([#6314](AztecProtocol/aztec-packages#6314))
([ea6ccdd](AztecProtocol/aztec-packages@ea6ccdd))
* Debug logs for all
([#6392](AztecProtocol/aztec-packages#6392))
([10afa13](AztecProtocol/aztec-packages@10afa13))
* Demonstrating use of nsk_app to check nullification
([#6362](AztecProtocol/aztec-packages#6362))
([ddf4461](AztecProtocol/aztec-packages@ddf4461))
* Use gas estimation in aztecjs contract function interactions
([#6260](AztecProtocol/aztec-packages#6260))
([18192ac](AztecProtocol/aztec-packages@18192ac))


### Miscellaneous

* Add more serialisation traits to protocol circuits
([#6385](AztecProtocol/aztec-packages#6385))
([97d5422](AztecProtocol/aztec-packages@97d5422))
* **ci:** Bump timeout of prover-client-test
([#6394](AztecProtocol/aztec-packages#6394))
([d05cd07](AztecProtocol/aztec-packages@d05cd07))
* Reenable bench summary
([#6211](AztecProtocol/aztec-packages#6211))
([713b243](AztecProtocol/aztec-packages@713b243))
* **token-contract-tests:** Change intrinsic assertion messages
([#6386](AztecProtocol/aztec-packages#6386))
([aca81ae](AztecProtocol/aztec-packages@aca81ae))
</details>

<details><summary>barretenberg: 0.40.0</summary>

##
[0.40.0](AztecProtocol/aztec-packages@barretenberg-v0.39.0...barretenberg-v0.40.0)
(2024-05-14)


### ⚠ BREAKING CHANGES

* debug logs for all
([#6392](AztecProtocol/aztec-packages#6392))

### Features

* Debug logs for all
([#6392](AztecProtocol/aztec-packages#6392))
([10afa13](AztecProtocol/aztec-packages@10afa13))


### Miscellaneous

* Add more serialisation traits to protocol circuits
([#6385](AztecProtocol/aztec-packages#6385))
([97d5422](AztecProtocol/aztec-packages@97d5422))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
iakovenkos pushed a commit that referenced this pull request May 15, 2024
…6260)

Adds an `estimateGas` flag to the `send` method of contract function
interactions (defaulting to false for now) to run an initial simulate on
the request to get the gas limits before actually sending the tx.
iakovenkos pushed a commit that referenced this pull request May 15, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.40.0</summary>

##
[0.40.0](aztec-package-v0.39.0...aztec-package-v0.40.0)
(2024-05-14)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.40.0</summary>

##
[0.40.0](barretenberg.js-v0.39.0...barretenberg.js-v0.40.0)
(2024-05-14)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-packages: 0.40.0</summary>

##
[0.40.0](aztec-packages-v0.39.0...aztec-packages-v0.40.0)
(2024-05-14)


### ⚠ BREAKING CHANGES

* debug logs for all
([#6392](#6392))

### Features

* Add wasmtime
([#6314](#6314))
([ea6ccdd](ea6ccdd))
* Debug logs for all
([#6392](#6392))
([10afa13](10afa13))
* Demonstrating use of nsk_app to check nullification
([#6362](#6362))
([ddf4461](ddf4461))
* Use gas estimation in aztecjs contract function interactions
([#6260](#6260))
([18192ac](18192ac))


### Miscellaneous

* Add more serialisation traits to protocol circuits
([#6385](#6385))
([97d5422](97d5422))
* **ci:** Bump timeout of prover-client-test
([#6394](#6394))
([d05cd07](d05cd07))
* Reenable bench summary
([#6211](#6211))
([713b243](713b243))
* **token-contract-tests:** Change intrinsic assertion messages
([#6386](#6386))
([aca81ae](aca81ae))
</details>

<details><summary>barretenberg: 0.40.0</summary>

##
[0.40.0](barretenberg-v0.39.0...barretenberg-v0.40.0)
(2024-05-14)


### ⚠ BREAKING CHANGES

* debug logs for all
([#6392](#6392))

### Features

* Debug logs for all
([#6392](#6392))
([10afa13](10afa13))


### Miscellaneous

* Add more serialisation traits to protocol circuits
([#6385](#6385))
([97d5422](97d5422))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

2 participants