Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d9637e2
fix: proposer sign digest of attestations
LHerskind Sep 8, 2025
7ea0a9d
chore: silence unhelpful forge lints
TomAFrench Sep 8, 2025
c43e8fa
feat: local ejection threshold
LHerskind Sep 9, 2025
fd5c89f
chore: add few extra checks
LHerskind Sep 5, 2025
b7f8edb
fix: never use cache in `verifyProposer`
LHerskind Sep 5, 2025
89cb04c
chore: Try fix slash veto demo flake
spalladino Sep 10, 2025
d5c34c9
fix: align timestamps for sample values
LHerskind Sep 11, 2025
f2b2603
chore: minor misc solidity changes
LHerskind Sep 8, 2025
3487a58
chore: reject gov deposit into gov
LHerskind Sep 12, 2025
50296c1
fix: error prefix
LHerskind Sep 11, 2025
9e80e2d
fix: unbounded lock delay
LHerskind Sep 11, 2025
8926109
chore: update coin issuer rate
LHerskind Sep 12, 2025
051560e
feat: Allow vetoer to disable slasher
spalladino Sep 10, 2025
857538a
chore: Fix governance vote test
spalladino Sep 12, 2025
67f95f6
chore: update zkpassport version (#17044)
saleel Sep 16, 2025
bf79669
chore: add validity period check on zkpassport (#17054)
saleel Sep 16, 2025
2e18d12
feat: queue flushing update
LHerskind Sep 29, 2025
c6353d4
chore: add comment to addRollup
LHerskind Sep 22, 2025
7bfabdd
chore: update gse deposit natspec (#17247)
LHerskind Sep 25, 2025
f215a2b
chore: fix misc issues for clarity
LHerskind Sep 22, 2025
c738fc6
fix: gas boundary and removal of isOnCurve
LHerskind Sep 25, 2025
dbb75aa
fix: Fix the hash to point function randomness
LHerskind Sep 25, 2025
10d148c
fix: tmnt 405, 411, 413, 414, 418, 419, 421, 425
LHerskind Sep 26, 2025
c27ef29
fix: tmnt 412
LHerskind Sep 25, 2025
eafef4f
chore: adding missing chain_l2_config
LHerskind Sep 29, 2025
fa79454
chore: address palla comments
LHerskind Sep 30, 2025
b020f76
fix: update hash to point
LHerskind Sep 30, 2025
2d75452
chore: allow zero address in gov constructor to open floodgates
LHerskind Sep 30, 2025
ee1c6d2
chore: rewind time of chain_l2_config
LHerskind Sep 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions barretenberg/sol/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ runs = 2

solc = "0.8.29"

[lint]
ignore = ["./lib/**"]
exclude_lints = [
# Silencing due to just being style changes
"mixed-case-variable",
"mixed-case-function",
"screaming-snake-case-const",
"screaming-snake-case-immutable",
]

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
1 change: 1 addition & 0 deletions barretenberg/sol/src/honk/HonkTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ library Honk {
G1Point kzgQuotient;
}

/// forge-lint: disable-next-item(pascal-case-struct)
struct ZKProof {
// Pairing point object
Fr[PAIRING_POINTS_SIZE] pairingPointObject;
Expand Down
1 change: 1 addition & 0 deletions barretenberg/sol/src/honk/ZKTranscript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {Fr, FrLib} from "./Fr.sol";
import {bytesToG1Point, bytesToFr} from "./utils.sol";

// ZKTranscript library to generate fiat shamir challenges, the ZK transcript only differest
/// forge-lint: disable-next-item(pascal-case-struct)
struct ZKTranscript {
// Oink
Honk.RelationParameters relationParameters;
Expand Down
1 change: 0 additions & 1 deletion barretenberg/sol/test/base/DifferentialFuzzer.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pragma solidity >=0.8.21;

import {Vm} from "forge-std/Vm.sol";
import {strings} from "stringutils/strings.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {TestBase} from "./TestBase.sol";
Expand Down
1 change: 1 addition & 0 deletions barretenberg/sol/test/honk/Add2.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {Add2HonkVerifier} from "../../src/honk/instance/Add2Honk.sol";
import {DifferentialFuzzer} from "../base/DifferentialFuzzer.sol";
import {IVerifier} from "../../src/interfaces/IVerifier.sol";

/// forge-lint: disable-next-item(unaliased-plain-import)
import "forge-std/console.sol";

contract Add2HonkTest is TestBaseHonk {
Expand Down
1 change: 1 addition & 0 deletions barretenberg/sol/test/honk/Add2ZK.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {Add2HonkZKVerifier} from "../../src/honk/instance/Add2HonkZK.sol";
import {DifferentialFuzzer} from "../base/DifferentialFuzzer.sol";
import {IVerifier} from "../../src/interfaces/IVerifier.sol";

/// forge-lint: disable-next-item(unaliased-plain-import)
import "forge-std/console.sol";

contract Add2HonkZKTest is TestBaseHonkZK {
Expand Down
1 change: 1 addition & 0 deletions barretenberg/sol/test/honk/Blake.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {BlakeHonkVerifier} from "../../src/honk/instance/BlakeHonk.sol";
import {DifferentialFuzzer} from "../base/DifferentialFuzzer.sol";
import {IVerifier} from "../../src/interfaces/IVerifier.sol";

/// forge-lint: disable-next-item(unaliased-plain-import)
import "forge-std/console.sol";

contract BlakeHonkTest is TestBaseHonk {
Expand Down
1 change: 1 addition & 0 deletions barretenberg/sol/test/honk/BlakeZK.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {BlakeHonkZKVerifier} from "../../src/honk/instance/BlakeHonkZK.sol";
import {DifferentialFuzzer} from "../base/DifferentialFuzzer.sol";
import {IVerifier} from "../../src/interfaces/IVerifier.sol";

/// forge-lint: disable-next-item(unaliased-plain-import)
import "forge-std/console.sol";

contract BlakeHonZKTest is TestBaseHonkZK {
Expand Down
1 change: 1 addition & 0 deletions barretenberg/sol/test/honk/Recursive.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {RecursiveHonkVerifier} from "../../src/honk/instance/RecursiveHonk.sol";
import {DifferentialFuzzer} from "../base/DifferentialFuzzer.sol";
import {IVerifier} from "../../src/interfaces/IVerifier.sol";

/// forge-lint: disable-next-item(unaliased-plain-import)
import "forge-std/console.sol";

contract RecursiveHonkTest is TestBaseHonk {
Expand Down
1 change: 1 addition & 0 deletions barretenberg/sol/test/honk/RecursiveZK.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {RecursiveHonkZKVerifier} from "../../src/honk/instance/RecursiveHonkZK.s
import {DifferentialFuzzer} from "../base/DifferentialFuzzer.sol";
import {IVerifier} from "../../src/interfaces/IVerifier.sol";

/// forge-lint: disable-next-item(unaliased-plain-import)
import "forge-std/console.sol";

contract RecursiveHonkTest is TestBaseHonkZK {
Expand Down
27 changes: 14 additions & 13 deletions docs/versioned_docs/version-v2.0.2/aztec/concepts/call_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Contract functions marked with `#[private]` can only be called privately, and as

Private functions from other contracts can be called either regularly or statically by using the `.call()` and `.static_call` functions. They will also be 'executed' (i.e. proved) in the user's device, and `static_call` will fail if any state changes are attempted (like the EVM's `STATICCALL`).

```rust title="private_call" showLineNumbers
```rust title="private_call" showLineNumbers
let _ = Token::at(stable_coin).burn_private(from, amount, authwit_nonce).call(&mut context);
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v2.0.2/noir-projects/noir-contracts/contracts/app/lending_contract/src/main.nr#L254-L256" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/app/lending_contract/src/main.nr#L254-L256</a></sub></sup>
Expand All @@ -117,7 +117,7 @@ Since public execution can only be performed by the sequencer, public functions

Since the public call is made asynchronously, any return values or side effects are not available during private execution. If the public function fails once executed, the entire transaction is reverted including state changes caused by the private part, such as new notes or nullifiers. Note that this does result in gas being spent, like in the case of the EVM.

```rust title="enqueue_public" showLineNumbers
```rust title="enqueue_public" showLineNumbers
Lending::at(context.this_address())
._deposit(AztecAddress::from_field(on_behalf_of), amount, collateral_asset)
.enqueue(&mut context);
Expand All @@ -129,7 +129,7 @@ It is also possible to create public functions that can _only_ be invoked by pri

A common pattern is to enqueue public calls to check some validity condition on public state, e.g. that a deadline has not expired or that some public value is set.

```rust title="enqueueing" showLineNumbers
```rust title="enqueueing" showLineNumbers
Router::at(ROUTER_ADDRESS).check_block_number(operation, value).call(context);
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v2.0.2/noir-projects/noir-contracts/contracts/protocol/router_contract/src/utils.nr#L17-L19" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/protocol/router_contract/src/utils.nr#L17-L19</a></sub></sup>
Expand All @@ -140,15 +140,15 @@ For this reason we've created a canonical router contract which implements some

An example of how a deadline can be checked using the router contract follows:

```rust title="call-check-deadline" showLineNumbers
```rust title="call-check-deadline" showLineNumbers
privately_check_timestamp(Comparator.LT, config.deadline, &mut context);
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v2.0.2/noir-projects/noir-contracts/contracts/app/crowdfunding_contract/src/main.nr#L65-L67" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/app/crowdfunding_contract/src/main.nr#L65-L67</a></sub></sup>


`privately_check_timestamp` and `privately_check_block_number` are helper functions around the call to the router contract:

```rust title="helper_router_functions" showLineNumbers
```rust title="helper_router_functions" showLineNumbers
/// Asserts that the current timestamp in the enqueued public call enqueued by `check_timestamp` satisfies
/// the `operation` with respect to the `value. Preserves privacy by performing the check via the router contract.
/// This conceals an address of the calling contract by setting `context.msg_sender` to the router contract address.
Expand All @@ -168,7 +168,7 @@ pub fn privately_check_block_number(operation: u8, value: u32, context: &mut Pri

This is what the implementation of the check timestamp functionality looks like:

```rust title="check_timestamp" showLineNumbers
```rust title="check_timestamp" showLineNumbers
/// Asserts that the current timestamp in the enqueued public call satisfies the `operation` with respect
/// to the `value.
#[private]
Expand Down Expand Up @@ -213,7 +213,7 @@ Since private calls are always run in a user's device, it is not possible to per

Public functions in other contracts can be called both regularly and statically, just like on the EVM.

```rust title="public_call" showLineNumbers
```rust title="public_call" showLineNumbers
Token::at(config.accepted_asset)
.transfer_in_public(context.msg_sender(), context.this_address(), max_fee, authwit_nonce
)
Expand All @@ -238,7 +238,7 @@ There are three different ways to execute an Aztec contract function using the `

This is used to get a result out of an execution, either private or public. It creates no transaction and spends no gas. The mental model is fairly close to that of [`eth_call`](#eth_call), in that it can be used to call any type of function, simulate its execution and get a result out of it. `simulate` is also the only way to run [utility functions](#utility).

```rust title="public_getter" showLineNumbers
```rust title="public_getter" showLineNumbers
#[public]
#[view]
fn get_authorized() -> AztecAddress {
Expand All @@ -248,7 +248,7 @@ fn get_authorized() -> AztecAddress {
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v2.0.2/noir-projects/noir-contracts/contracts/app/auth_contract/src/main.nr#L42-L50" target="_blank" rel="noopener noreferrer">Source code: noir-projects/noir-contracts/contracts/app/auth_contract/src/main.nr#L42-L50</a></sub></sup>


```typescript title="simulate_function" showLineNumbers
```typescript title="simulate_function" showLineNumbers
const balance = await contract.methods.balance_of_public(newAccountAddress).simulate({ from: newAccountAddress });
expect(balance).toEqual(1n);
```
Expand All @@ -263,9 +263,10 @@ No correctness is guaranteed on the result of `simulate`! Correct execution is e

This creates and returns a transaction request, which includes proof of correct private execution and side-effects. The request is not broadcast however, and no gas is spent. It is typically used in testing contexts to inspect transaction parameters or to check for execution failure.

```typescript title="local-tx-fails" showLineNumbers
const call = token.methods.transfer(recipientAddress, 200n);
await expect(call.simulate({ from: ownerAddress })).rejects.toThrow(/Balance too low/);
```typescript title="local-tx-fails" showLineNumbers
await expect(
claimContract.methods.claim(anotherDonationNote, donorAddress).send({ from: unrelatedAddress }).wait(),
).rejects.toThrow('Note does not belong to the sender');
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v2.0.2/yarn-project/end-to-end/src/guides/dapp_testing.test.ts#L136-L139" target="_blank" rel="noopener noreferrer">Source code: yarn-project/end-to-end/src/guides/dapp_testing.test.ts#L136-L139</a></sub></sup>

Expand All @@ -274,7 +275,7 @@ await expect(call.simulate({ from: ownerAddress })).rejects.toThrow(/Balance too

This is the same as [`prove`](#prove) except it also broadcasts the transaction and returns a receipt. This is how transactions are sent, getting them to be included in blocks and spending gas. It is similar to [`eth_sendTransaction`](#eth_sendtransaction), except it also performs some work on the user's device, namely the production of the proof for the private part of the transaction.

```typescript title="send_tx" showLineNumbers
```typescript title="send_tx" showLineNumbers
await contract.methods.buy_pack(seed).send({ from: firstPlayer }).wait();
```
> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/v2.0.2/yarn-project/end-to-end/src/e2e_card_game.test.ts#L129-L131" target="_blank" rel="noopener noreferrer">Source code: yarn-project/end-to-end/src/e2e_card_game.test.ts#L129-L131</a></sub></sup>
Expand Down
15 changes: 15 additions & 0 deletions l1-contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,20 @@ wrap_comments = true
number_underscore = "thousands"
override_spacing = false

[lint]
ignore = ["./lib/**"]
exclude_lints = [
"unused-import", # Mostly in test code
"incorrect-shift", # Throws warnings on construction of bitmasks

"asm-keccak256", # https://github.com/AztecProtocol/aztec-packages/issues/16808

# Silencing due to just being style changes
"mixed-case-variable",
"mixed-case-function",
"screaming-snake-case-const",
"screaming-snake-case-immutable",
]

[rpc_endpoints]
mainnet_fork = "https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c"
3 changes: 2 additions & 1 deletion l1-contracts/script/StakingAssetHandler.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ contract StakingAssetHandlerScript is Test {
domain: DOMAIN,
scope: SCOPE,
skipBindCheck: false, // DO NOT: skip bind check
skipMerkleCheck: true // DO: skip merkle check
skipMerkleCheck: true, // DO: skip merkle check
validatorsToFlush: 48
});

vm.startBroadcast(ME);
Expand Down
Loading
Loading