Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into lw/private_logs
Browse files Browse the repository at this point in the history
  • Loading branch information
LeilaWang committed Nov 28, 2024
2 parents f5a8d84 + c48ae90 commit 240ec0e
Show file tree
Hide file tree
Showing 44 changed files with 1,166 additions and 182 deletions.
8 changes: 4 additions & 4 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
".": "0.65.1",
".": "0.65.2",
"yarn-project/cli": "0.35.1",
"yarn-project/aztec": "0.65.1",
"barretenberg": "0.65.1",
"barretenberg/ts": "0.65.1"
"yarn-project/aztec": "0.65.2",
"barretenberg": "0.65.2",
"barretenberg/ts": "0.65.2"
}
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## [0.65.2](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.65.1...aztec-packages-v0.65.2) (2024-11-28)


### Features

* Fee foresight support ([#10262](https://github.com/AztecProtocol/aztec-packages/issues/10262)) ([9e19244](https://github.com/AztecProtocol/aztec-packages/commit/9e19244c01440ce7900ba91c0557567e57f017a0))
* New proving broker ([#10174](https://github.com/AztecProtocol/aztec-packages/issues/10174)) ([6fd5fc1](https://github.com/AztecProtocol/aztec-packages/commit/6fd5fc18bd973b539fb9edfb372181fbe4617f75))
* Sequential insertion in indexed trees ([#10111](https://github.com/AztecProtocol/aztec-packages/issues/10111)) ([bfd9fa6](https://github.com/AztecProtocol/aztec-packages/commit/bfd9fa68be4147acb3e3feeaf83ed3c9247761be))
* Swap polys to facilitate dynamic trace overflow ([#9976](https://github.com/AztecProtocol/aztec-packages/issues/9976)) ([b7b282c](https://github.com/AztecProtocol/aztec-packages/commit/b7b282cd0fb306abbe3951a55a1a4f4d42ed7f8e))


### Bug Fixes

* Don't store indices of zero leaves. ([#10270](https://github.com/AztecProtocol/aztec-packages/issues/10270)) ([c22be8b](https://github.com/AztecProtocol/aztec-packages/commit/c22be8b23e6d16cf4a60509494b979c3edfdba9b))
* Expect proper duplicate nullifier error patterns in e2e tests ([#10256](https://github.com/AztecProtocol/aztec-packages/issues/10256)) ([4ee8344](https://github.com/AztecProtocol/aztec-packages/commit/4ee83448a24be1944ca8c71d42ae8aa15049af10))


### Miscellaneous

* Check artifact consistency ([#10271](https://github.com/AztecProtocol/aztec-packages/issues/10271)) ([6a49405](https://github.com/AztecProtocol/aztec-packages/commit/6a494050f85510c18870117f376280d8e10ed486))
* Dont import things that themselves import jest in imported functions ([#10260](https://github.com/AztecProtocol/aztec-packages/issues/10260)) ([9440c1c](https://github.com/AztecProtocol/aztec-packages/commit/9440c1cf3834eea380014d55eef6e81cff8ffee8))
* Fix bad merge in integration l1 publisher ([#10272](https://github.com/AztecProtocol/aztec-packages/issues/10272)) ([b5a6aa4](https://github.com/AztecProtocol/aztec-packages/commit/b5a6aa4ce51a27b220162d48ba065a0077b9fcd8))
* Fixing sol warnings ([#10276](https://github.com/AztecProtocol/aztec-packages/issues/10276)) ([3d113b2](https://github.com/AztecProtocol/aztec-packages/commit/3d113b212b4641b2a97e6b2b0b4835908f3957c8))
* Pull out sync changes ([#10274](https://github.com/AztecProtocol/aztec-packages/issues/10274)) ([391a6b7](https://github.com/AztecProtocol/aztec-packages/commit/391a6b7377a5253f2c47fa5ec949f255b284da00))
* Pull value merger code from sync ([#10080](https://github.com/AztecProtocol/aztec-packages/issues/10080)) ([3392629](https://github.com/AztecProtocol/aztec-packages/commit/3392629818e6d51c01ca4c75c1ad916bb4b4fdb1))
* Remove default gas settings ([#10163](https://github.com/AztecProtocol/aztec-packages/issues/10163)) ([c9a4d88](https://github.com/AztecProtocol/aztec-packages/commit/c9a4d88b15c320e6cc6d79e0721d0f4062d2d840))
* Replace relative paths to noir-protocol-circuits ([654d801](https://github.com/AztecProtocol/aztec-packages/commit/654d801dc762ce69589a300ef6a2d8fe590527a8))
* Teardown context in prover coordination test ([#10257](https://github.com/AztecProtocol/aztec-packages/issues/10257)) ([7ea3888](https://github.com/AztecProtocol/aztec-packages/commit/7ea38887e514a4bbdc7ff847efe19bd2d1b74baf))

## [0.65.1](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.65.0...aztec-packages-v0.65.1) (2024-11-27)


Expand Down
18 changes: 18 additions & 0 deletions barretenberg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [0.65.2](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.65.1...barretenberg-v0.65.2) (2024-11-28)


### Features

* Sequential insertion in indexed trees ([#10111](https://github.com/AztecProtocol/aztec-packages/issues/10111)) ([bfd9fa6](https://github.com/AztecProtocol/aztec-packages/commit/bfd9fa68be4147acb3e3feeaf83ed3c9247761be))
* Swap polys to facilitate dynamic trace overflow ([#9976](https://github.com/AztecProtocol/aztec-packages/issues/9976)) ([b7b282c](https://github.com/AztecProtocol/aztec-packages/commit/b7b282cd0fb306abbe3951a55a1a4f4d42ed7f8e))


### Bug Fixes

* Don't store indices of zero leaves. ([#10270](https://github.com/AztecProtocol/aztec-packages/issues/10270)) ([c22be8b](https://github.com/AztecProtocol/aztec-packages/commit/c22be8b23e6d16cf4a60509494b979c3edfdba9b))


### Miscellaneous

* Pull value merger code from sync ([#10080](https://github.com/AztecProtocol/aztec-packages/issues/10080)) ([3392629](https://github.com/AztecProtocol/aztec-packages/commit/3392629818e6d51c01ca4c75c1ad916bb4b4fdb1))

## [0.65.1](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.65.0...barretenberg-v0.65.1) (2024-11-27)


Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
project(
Barretenberg
DESCRIPTION "BN254 elliptic curve library, and PLONK SNARK prover"
VERSION 0.65.1 # x-release-please-version
VERSION 0.65.2 # x-release-please-version
LANGUAGES CXX C
)
# Insert version into `bb` config file
Expand Down
7 changes: 7 additions & 0 deletions barretenberg/ts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.65.2](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.65.1...barretenberg.js-v0.65.2) (2024-11-28)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions

## [0.65.1](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.65.0...barretenberg.js-v0.65.1) (2024-11-27)


Expand Down
2 changes: 1 addition & 1 deletion barretenberg/ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aztec/bb.js",
"packageManager": "[email protected]",
"version": "0.65.1",
"version": "0.65.2",
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg/ts",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/Outbox.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ contract OutboxTest is Test {
}
}

function testCheckOutOfBoundsStatus(uint256 _blockNumber, uint256 _leafIndex) public {
function testCheckOutOfBoundsStatus(uint256 _blockNumber, uint256 _leafIndex) public view {
bool outOfBounds = outbox.hasMessageBeenConsumedAtBlockAndIndex(_blockNumber, _leafIndex);
assertFalse(outOfBounds);
}
Expand Down
14 changes: 7 additions & 7 deletions l1-contracts/test/decoders/Decoders.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ contract DecodersTest is DecoderBase {
// The public inputs are computed based of these values, but not directly part of the decoding per say.
}

function testComputeKernelLogsIterationWithoutLogs() public {
function testComputeKernelLogsIterationWithoutLogs() public view {
bytes memory kernelLogsLength = hex"00000004"; // 4 bytes containing value 4
bytes memory iterationLogsLength = hex"00000000"; // 4 empty bytes indicating that length of this iteration's logs is 0
bytes memory encodedLogs = abi.encodePacked(kernelLogsLength, iterationLogsLength);
Expand All @@ -181,7 +181,7 @@ contract DecodersTest is DecoderBase {
assertEq(logsHash, bytes32(0), "Incorrect logs hash");
}

function testComputeKernelLogs1Iteration() public {
function testComputeKernelLogs1Iteration() public view {
// || K_LOGS_LEN | I1_LOGS_LEN | I1_LOGS ||
// K_LOGS_LEN = 4 + 8 = 12 (hex"0000000c")
// I1_LOGS_LEN = 8 (hex"00000008")
Expand Down Expand Up @@ -215,7 +215,7 @@ contract DecodersTest is DecoderBase {
assertEq(logsHash, referenceLogsHash, "Incorrect logs hash");
}

function testComputeKernelLogs2Iterations() public {
function testComputeKernelLogs2Iterations() public view {
// || K_LOGS_LEN | I1_LOGS_LEN | I1_LOGS | I2_LOGS_LEN | I2_LOGS ||
// K_LOGS_LEN = 4 + 8 + 4 + 20 = 36 (hex"00000024")
// I1_LOGS_LEN = 8 (hex"00000008")
Expand Down Expand Up @@ -265,7 +265,7 @@ contract DecodersTest is DecoderBase {
assertEq(logsHash, referenceLogsHashFromIteration2, "Incorrect logs hash");
}

function testComputeKernelLogsMiddleIterationWithoutLogs() public {
function testComputeKernelLogsMiddleIterationWithoutLogs() public view {
// || K_LOGS_LEN | I1_LOGS_LEN | I1_LOGS | I2_LOGS_LEN | I2_LOGS | I3_LOGS_LEN | I3_LOGS ||
// K_LOGS_LEN = 4 + 8 + 4 + 0 + 4 + 20 = 40 (hex"00000028")
// I1_LOGS_LEN = 8 (hex"00000008")
Expand Down Expand Up @@ -323,7 +323,7 @@ contract DecodersTest is DecoderBase {
assertEq(logsHash, referenceLogsHashFromIteration3, "Incorrect logs hash");
}

function testComputeTxOutHash() public {
function testComputeTxOutHash() public view {
// A tx with no msgs should give an out hash of 0
bytes memory encodedMsgs = abi.encodePacked(hex"00");
bytes32 outHash = txsHelper.computeTxOutHash(encodedMsgs);
Expand All @@ -338,7 +338,7 @@ contract DecodersTest is DecoderBase {
assertEq(outHash, expectedOutHash, "Incorrect tx out hash");
}

function testTxsDecoderCorrectlyComputesNumTxEffectsToPad() public {
function testTxsDecoderCorrectlyComputesNumTxEffectsToPad() public view {
// Minimum num txs is 2 so when there are no real txs we need to pad to 2
uint32 numTxEffects = 0;
uint32 paddedNumTxEffects = txsHelper.computeNumTxEffectsToPad(numTxEffects);
Expand All @@ -357,7 +357,7 @@ contract DecodersTest is DecoderBase {
assertEq(paddedNumTxEffects, 0, "Incorrect number of tx effects to pad");
}

function testTxsDecoderCorrectlyComputesNumMsgsToPad() public {
function testTxsDecoderCorrectlyComputesNumMsgsToPad() public view {
uint32 numMsgs = 0;
uint32 numMsgsToPad = txsHelper.computeNumMsgsToPad(numMsgs);
assertEq(numMsgsToPad, 1, "Incorrect number of msgs to pad");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {RegistryBase} from "./Base.t.sol";
import {DataStructures} from "@aztec/governance/libraries/DataStructures.sol";

contract GetCurrentSnapshotTest is RegistryBase {
function test_GivenOneListedRollup() external {
function test_GivenOneListedRollup() external view {
// it should return the newest
DataStructures.RegistrySnapshot memory snapshot = registry.getCurrentSnapshot();
assertEq(snapshot.blockNumber, block.number);
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/governance/registry/getRollup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity >=0.8.27;
import {RegistryBase} from "./Base.t.sol";

contract GetRollupTest is RegistryBase {
function test_GivenOneListedRollup() external {
function test_GivenOneListedRollup() external view {
// it should return the newest
assertEq(registry.getRollup(), address(0xdead));
}
Expand Down
8 changes: 6 additions & 2 deletions l1-contracts/test/governance/registry/getSnapshot.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract GetSnapshotTest is RegistryBase {
_;
}

function test_When_versionExists() external givenMultipleListedRollups {
function test_When_versionExists() external view givenMultipleListedRollups {
// it should return the snapshot

DataStructures.RegistrySnapshot memory snapshot = registry.getSnapshot(0);
Expand All @@ -19,7 +19,11 @@ contract GetSnapshotTest is RegistryBase {
assertEq(registry.numberOfVersions(), 1);
}

function test_When_versionDoesNotExists(uint256 _version) external givenMultipleListedRollups {
function test_When_versionDoesNotExists(uint256 _version)
external
view
givenMultipleListedRollups
{
// it should return empty snapshot

uint256 version = bound(_version, 1, type(uint256).max);
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/governance/registry/getVersionFor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract GetVersionForTest is RegistryBase {
_;
}

function test_When_rollupIs0xdead() external givenNoAdditionalListedRollups {
function test_When_rollupIs0xdead() external view givenNoAdditionalListedRollups {
// it should return 0
assertEq(registry.getVersionFor(address(0xdead)), 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ contract IsRollupRegisteredTest is RegistryBase {
_;
}

function test_When_rollupIs0xdead() external givenNoAdditionalListedRollups {
function test_When_rollupIs0xdead() external view givenNoAdditionalListedRollups {
// it should return true
assertTrue(registry.isRollupRegistered(address(0xdead)));
}

function test_When_rollupNot0xdead(address _rollup) external givenNoAdditionalListedRollups {
function test_When_rollupNot0xdead(address _rollup) external view givenNoAdditionalListedRollups {
// it should return false
vm.assume(_rollup != address(0xdead));
assertFalse(registry.isRollupRegistered(_rollup));
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/merkle/TestUtil.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract MerkleTestUtil is Test {
return (2 ** height) != originalNumber ? ++height : height;
}

function testCalculateTreeHeightFromSize() external {
function testCalculateTreeHeightFromSize() external pure {
assertEq(calculateTreeHeightFromSize(0), 1);
assertEq(calculateTreeHeightFromSize(1), 1);
assertEq(calculateTreeHeightFromSize(2), 1);
Expand Down
12 changes: 6 additions & 6 deletions l1-contracts/test/merkle/UnbalancedMerkle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract UnbalancedMerkleTest is Test {
txsHelper = new TxsDecoderHelper();
}

function testDecomp() public {
function testDecomp() public view {
// Worst case - max num txs
uint32 numTxs = 65535;
(uint256 min, uint256 max) = txsHelper.computeMinMaxPathLength(numTxs);
Expand Down Expand Up @@ -62,7 +62,7 @@ contract UnbalancedMerkleTest is Test {
// root
// / \
// base base
function testComputeTxsEffectsHash2() public {
function testComputeTxsEffectsHash2() public view {
// Generate some base leaves
bytes32[] memory baseLeaves = new bytes32[](2);
for (uint256 i = 0; i < 2; i++) {
Expand All @@ -84,7 +84,7 @@ contract UnbalancedMerkleTest is Test {
// / \
// base base

function testComputeTxsEffectsHash3() public {
function testComputeTxsEffectsHash3() public view {
// Generate some base leaves
bytes32[] memory baseLeaves = new bytes32[](3);
for (uint256 i = 0; i < 3; i++) {
Expand All @@ -109,7 +109,7 @@ contract UnbalancedMerkleTest is Test {
// merge merge
// / \ / \
// base base base base
function testComputeTxsEffectsHash5() public {
function testComputeTxsEffectsHash5() public view {
// Generate some base leaves
bytes32[] memory baseLeaves = new bytes32[](5);
for (uint256 i = 0; i < 5; i++) {
Expand Down Expand Up @@ -139,7 +139,7 @@ contract UnbalancedMerkleTest is Test {
// merge1 merge2 base base
// / \ / \
// base base base base
function testComputeTxsEffectsHash6() public {
function testComputeTxsEffectsHash6() public view {
// Generate some base leaves
bytes32[] memory baseLeaves = new bytes32[](6);
for (uint256 i = 0; i < 6; i++) {
Expand Down Expand Up @@ -171,7 +171,7 @@ contract UnbalancedMerkleTest is Test {
// merge1 merge2 merge4 base
// / \ / \ / \
// base base base base base base
function testComputeTxsEffectsHash7() public {
function testComputeTxsEffectsHash7() public view {
// Generate some base leaves
bytes32[] memory baseLeaves = new bytes32[](7);
for (uint256 i = 0; i < 6; i++) {
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/sparta/Sampling.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract Sampler {
contract SamplingTest is Test {
Sampler sampler = new Sampler();

function testShuffle() public {
function testShuffle() public view {
// Sizes pulled out of thin air
uint256 setSize = 1024;
uint256 commiteeSize = 32;
Expand Down
3 changes: 3 additions & 0 deletions noir/noir-repo/.github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ jobs:

- name: Install Foundry
uses: foundry-rs/[email protected]
with:
version: nightly-8660e5b941fe7f4d67e246cfd3dafea330fb53b1


- name: Install `bb`
run: |
Expand Down
38 changes: 37 additions & 1 deletion noir/noir-repo/compiler/noirc_errors/src/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ impl Span {
self.start() <= other.start() && self.end() >= other.end()
}

/// Returns `true` if any point of `self` intersects a point of `other`.
/// Adjacent spans are considered to intersect (so, for example, `0..1` intersects `1..3`).
pub fn intersects(&self, other: &Span) -> bool {
self.end() > other.start() && self.start() < other.end()
self.end() >= other.start() && self.start() <= other.end()
}

pub fn is_smaller(&self, other: &Span) -> bool {
Expand Down Expand Up @@ -140,3 +142,37 @@ impl Location {
self.file == other.file && self.span.contains(&other.span)
}
}

#[cfg(test)]
mod tests {
use crate::Span;

#[test]
fn test_intersects() {
assert!(Span::from(5..10).intersects(&Span::from(5..10)));

assert!(Span::from(5..10).intersects(&Span::from(5..5)));
assert!(Span::from(5..5).intersects(&Span::from(5..10)));

assert!(Span::from(10..10).intersects(&Span::from(5..10)));
assert!(Span::from(5..10).intersects(&Span::from(10..10)));

assert!(Span::from(5..10).intersects(&Span::from(6..9)));
assert!(Span::from(6..9).intersects(&Span::from(5..10)));

assert!(Span::from(5..10).intersects(&Span::from(4..11)));
assert!(Span::from(4..11).intersects(&Span::from(5..10)));

assert!(Span::from(5..10).intersects(&Span::from(4..6)));
assert!(Span::from(4..6).intersects(&Span::from(5..10)));

assert!(Span::from(5..10).intersects(&Span::from(9..11)));
assert!(Span::from(9..11).intersects(&Span::from(5..10)));

assert!(!Span::from(5..10).intersects(&Span::from(3..4)));
assert!(!Span::from(3..4).intersects(&Span::from(5..10)));

assert!(!Span::from(5..10).intersects(&Span::from(11..12)));
assert!(!Span::from(11..12).intersects(&Span::from(5..10)));
}
}
Loading

0 comments on commit 240ec0e

Please sign in to comment.