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: Sync from aztec-packages #4444

Merged
merged 3 commits into from
Feb 28, 2024
Merged

feat: Sync from aztec-packages #4444

merged 3 commits into from
Feb 28, 2024

Conversation

AztecBot
Copy link
Collaborator

BEGIN_COMMIT_OVERRIDE
chore: remove original return from aztec fns (AztecProtocol/aztec-packages#4804)
END_COMMIT_OVERRIDE

The following function:

```rust
#[aztec(private)]
fn do_work_conditionally() -> u64 {
  let condition = storage.flag;
  if condition {
     2
  } else {
     42
  }
}
```

Will be transformed by the macro, adding a push with the whole if/else
expression to `context.return_values`...but without removing the
statement in the first place, leading to duplicate code execution.

This PR forces the removal of the last function statement in case it is
replaced by a push to the context.
@TomAFrench TomAFrench added this pull request to the merge queue Feb 28, 2024
Merged via the queue into master with commit 9c20538 Feb 28, 2024
43 checks passed
TomAFrench added a commit that referenced this pull request Mar 2, 2024
* master: (27 commits)
  feat: skip redundant range checks in brillig (#4460)
  fix: Variables from trait constraints being permanently bound over when used within a trait impl (#4450)
  feat: Add overflow and underflow checks for unsigned integers in brillig (#4445)
  fix(flake): stop flake.nix removing ignored-tests.txt (#4455)
  fix: build noir_codegen when publishing (#4448)
  chore: only ignore Nargo.toml in `test_programs` directory and not su… (#4451)
  chore: create parser specifically for function visibility (#4425)
  chore: Document BoundedVec (#4430)
  chore: split up parser into separate files for code organisation (#4420)
  feat: Sync from aztec-packages (#4444)
  chore!: reserve `unchecked` keyword (#4432)
  chore: address code review comments of PR4398 (#4435)
  feat: Sync from aztec-packages (#4439)
  feat: Sync from aztec-packages (#4438)
  chore(docs): correct 'Edit this page' URL for dev docs (#4433)
  feat: Sync from aztec-packages (#4390)
  chore(docs): fix external contributor force push workflow (#4437)
  chore!: Remove empty value from bounded vec (#4431)
  chore: nargo fmt (#4434)
  feat: add poseidon2 opcode implementation for acvm/brillig, and Noir (#4398)
  ...
TomAFrench added a commit that referenced this pull request Mar 4, 2024
* master:
  chore: export `report_errors` from `nargo` (#4461)
  feat: add option to set max memory for bb.js (#4227)
  feat: backpropagate constants in ACIR during optimization (#3926)
  feat: skip redundant range checks in brillig (#4460)
  fix: Variables from trait constraints being permanently bound over when used within a trait impl (#4450)
  feat: Add overflow and underflow checks for unsigned integers in brillig (#4445)
  fix(flake): stop flake.nix removing ignored-tests.txt (#4455)
  fix: build noir_codegen when publishing (#4448)
  chore: only ignore Nargo.toml in `test_programs` directory and not su… (#4451)
  chore: create parser specifically for function visibility (#4425)
  chore: Document BoundedVec (#4430)
  chore: split up parser into separate files for code organisation (#4420)
  feat: Sync from aztec-packages (#4444)
  chore!: reserve `unchecked` keyword (#4432)
  chore: address code review comments of PR4398 (#4435)
  feat: Sync from aztec-packages (#4439)
  feat: Sync from aztec-packages (#4438)
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