Skip to content

Commit be41aad

Browse files
committed
Merge branch 'master' into tf/cross-block-deduplication
2 parents 1548c9e + 03b7e0e commit be41aad

File tree

417 files changed

+30638
-18667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

417 files changed

+30638
-18667
lines changed

.github/spot-runner-action/dist/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ class Ec2Instance {
281281
Ebs: {
282282
VolumeSize: 64,
283283
VolumeType: 'gp3',
284-
Throughput: 1000,
285-
Iops: 5000
284+
Throughput: 125,
285+
Iops: 3000
286286
},
287287
},
288288
],

.github/spot-runner-action/src/ec2.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ export class Ec2Instance {
200200
Ebs: {
201201
VolumeSize: 64,
202202
VolumeType: 'gp3',
203-
Throughput: 1000,
204-
Iops: 5000
203+
Throughput: 125,
204+
Iops: 3000
205205
},
206206
},
207207
],

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
concurrency_key: build-x86
158158
# prepare images locally, tagged by commit hash
159159
- name: "Build E2E Image"
160-
timeout-minutes: 40
160+
timeout-minutes: 90
161161
if: (needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true') || github.ref_name == 'master'
162162
run: |
163163
earthly-ci ./yarn-project+export-e2e-test-images
@@ -208,6 +208,7 @@ jobs:
208208
uses: ./.github/ensure-tester-with-images
209209
env:
210210
USERNAME: ${{ needs.configure.outputs.username }}
211+
PULL_REQUEST: ${{ github.event.pull_request.number }}
211212
with:
212213
runner_type: ${{ steps.runner_type.outputs.type }}
213214
builder_type: builder-x86

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ terraform.tfstate*
2525
.secret
2626
.bb_tmp
2727

28-
# Terraform
29-
*.tfvars
3028

3129
# tmux
3230
tmux-client-*.log

.release-please-manifest.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
".": "0.63.1",
2+
".": "0.64.0",
33
"yarn-project/cli": "0.35.1",
4-
"yarn-project/aztec": "0.63.1",
5-
"barretenberg": "0.63.1",
6-
"barretenberg/ts": "0.63.1"
4+
"yarn-project/aztec": "0.64.0",
5+
"barretenberg": "0.64.0",
6+
"barretenberg/ts": "0.64.0"
77
}

CHANGELOG.md

+144
Large diffs are not rendered by default.

avm-transpiler/Cargo.lock

-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

avm-transpiler/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ license = "MIT OR Apache-2.0"
1111
# local
1212
acvm = { path = "../noir/noir-repo/acvm-repo/acvm", features = ["bn254"] }
1313
noirc_errors = { path = "../noir/noir-repo/compiler/noirc_errors" }
14-
fxhash = "0.2.1"
1514

1615
# external
1716
base64 = "0.21"

avm-transpiler/README.md

+40-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,50 @@ This component transpiles Aztec public contracts code from Noir's Brillig byteco
55
## Build
66

77
```
8-
./boostrap.sh
8+
./bootstrap.sh
99
```
1010

1111
## Run
1212

1313
```
1414
cargo run <aztec-contract-artifact-json> <transpiled-output-json>
1515
```
16+
17+
## Testing Transpiler Changes
18+
19+
After bootstrap in `avm-transpiler`, go to `noir-contracts` and only compile avm_test_contract with:
20+
21+
```
22+
nargo compile --package avm_test_contract --inliner-aggressiveness=0 --silence-warnings
23+
```
24+
25+
Important: use the right nargo binary located in
26+
`aztec-packages/noir/noir-repo/target/release/nargo`
27+
If required, build nargo by going in `noir/noir-repo` and run
28+
`cargo build --release`.
29+
30+
Then, transpile it:
31+
32+
```
33+
scripts/transpile.sh
34+
```
35+
36+
Go to yarn-project/simulator and run:
37+
38+
```
39+
yarn build:fast
40+
```
41+
42+
This takes in the TS generated by the compilation and transpilation.
43+
44+
Finally, run
45+
46+
```
47+
yarn test src/avm/avm_simulator.test.ts
48+
```
49+
50+
To test against some .cpp changes, compile the bb binary and run bb prover test:
51+
52+
```
53+
yarn test src/avm_proving.test.ts
54+
```

avm-transpiler/src/instructions.rs

+25-10
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ pub struct AvmInstruction {
2222
/// Its usage will depend on the instruction.
2323
pub tag: Option<AvmTypeTag>,
2424

25-
/// Different instructions have different numbers of operands
25+
/// Different instructions have different numbers of operands. These operands contain
26+
/// memory addresses.
2627
pub operands: Vec<AvmOperand>,
28+
29+
// Operands which are immediate, i.e., contain hardcoded constants.
30+
pub immediates: Vec<AvmOperand>,
2731
}
2832

2933
impl Display for AvmInstruction {
@@ -32,35 +36,46 @@ impl Display for AvmInstruction {
3236
if let Some(indirect) = &self.indirect {
3337
write!(f, ", indirect: {}", indirect)?;
3438
}
35-
// This will be either inTag or dstTag depending on the operation
36-
if let Some(dst_tag) = self.tag {
37-
write!(f, ", tag: {}", dst_tag as u8)?;
38-
}
3939
if !self.operands.is_empty() {
4040
write!(f, ", operands: [")?;
4141
for operand in &self.operands {
4242
write!(f, "{operand}, ")?;
4343
}
4444
write!(f, "]")?;
4545
};
46+
// This will be either inTag or dstTag depending on the operation
47+
if let Some(dst_tag) = self.tag {
48+
write!(f, ", tag: {}", dst_tag as u8)?;
49+
}
50+
if !self.immediates.is_empty() {
51+
write!(f, ", immediates: [")?;
52+
for immediate in &self.immediates {
53+
write!(f, "{immediate}, ")?;
54+
}
55+
write!(f, "]")?;
56+
};
4657
Ok(())
4758
}
4859
}
4960

5061
impl AvmInstruction {
5162
/// Bytes representation for generating AVM bytecode
63+
/// Order: INDIRECT, OPERANDS, TAG, IMMEDIATES
5264
pub fn to_bytes(&self) -> Vec<u8> {
5365
let mut bytes = Vec::new();
5466
bytes.push(self.opcode as u8);
5567
if let Some(indirect) = &self.indirect {
5668
bytes.extend_from_slice(&indirect.to_be_bytes());
5769
}
70+
for operand in &self.operands {
71+
bytes.extend_from_slice(&operand.to_be_bytes());
72+
}
5873
// This will be either inTag or dstTag depending on the operation
5974
if let Some(tag) = self.tag {
6075
bytes.extend_from_slice(&(tag as u8).to_be_bytes());
6176
}
62-
for operand in &self.operands {
63-
bytes.extend_from_slice(&operand.to_be_bytes());
77+
for immediate in &self.immediates {
78+
bytes.extend_from_slice(&immediate.to_be_bytes());
6479
}
6580
bytes
6681
}
@@ -84,6 +99,7 @@ impl Default for AvmInstruction {
8499
indirect: None,
85100
tag: None,
86101
operands: vec![],
102+
immediates: vec![],
87103
}
88104
}
89105
}
@@ -102,9 +118,8 @@ pub enum AvmTypeTag {
102118
INVALID,
103119
}
104120

105-
/// Operands are usually 32 bits (offsets or jump destinations)
106-
/// Constants (as used by the SET instruction) can have size
107-
/// different from 32 bits
121+
/// Operands are usually 8, 16 and 32 bits (offsets)
122+
/// Immediates (as used by the SET instruction) can have different sizes
108123
#[allow(non_camel_case_types)]
109124
pub enum AvmOperand {
110125
U8 { value: u8 },

0 commit comments

Comments
 (0)