Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Ecrecover soundness #1597

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
538 commits
Select commit Hold shift + click to select a range
9d0e14d
Fix test-scroll to use go-version `1.19` in CI.
silathdiir Apr 26, 2023
7e821a9
fix advice non deterministic problem
lispc Apr 26, 2023
a31d7eb
Merge remote-tracking branch 'origin/main' into develop
lispc Apr 27, 2023
cb26abb
Merge remote-tracking branch 'origin/main' into develop
lispc Apr 27, 2023
7e456d0
fix tx circuit unusable rows
lispc Apr 27, 2023
d0cc1e9
Merge upstream u64-overflow PR back to develop (#496)
silathdiir May 2, 2023
9d6aa63
Support shanghai in geth tracer (#497)
lispc May 9, 2023
f90e262
Add `coinbase` to access list in `begin_tx` for EIP-3651 of Shanghai.…
silathdiir May 15, 2023
fcf1f95
[feat] add copy circuit test (#501)
lightsing May 15, 2023
83aa352
[Feat] Withdraw root constraint (#484)
noel2004 May 16, 2023
c5f0936
feat: sealer api (#502)
lispc May 16, 2023
fbcfd0f
print rw usage in bus mapping (#404)
lispc May 16, 2023
74c1d20
Support EIP-3860 (Limit and meter initcode) for Shanghai (#507)
silathdiir May 18, 2023
9f36600
feat: transaction L1 fee constraints (#499)
silathdiir May 19, 2023
e6bdb8d
Add `PUSH0`. (#510)
silathdiir May 22, 2023
e8aecb6
bytecode_circuit: fix padding_shift underconstrainted (#508)
noel2004 May 22, 2023
cd35d7b
testool: upgrade `testool/tests` (#511)
silathdiir May 25, 2023
6c9df1a
fix precompile revert
lispc May 25, 2023
44000e5
[chore] Expose keccak circuit config (#519)
zhenfeizhang May 29, 2023
bc306ac
fix some audit issues (#512)
lispc Jun 6, 2023
801a048
Feat: identity precompile (#514)
roynalnaruto Jun 7, 2023
79caaf4
feat: refactor rlp circuit and tx circuit to support more tx types (#…
kunxian-xia Jun 8, 2023
5e74c0c
Update `BLOCKHASH` output as `keccak(chain_id || block_number)` (#537)
silathdiir Jun 15, 2023
04d4bb4
test: copy circuit precompile call (identity) (#539)
roynalnaruto Jun 15, 2023
6c6865f
Set empty keccak codehash when account comes into existence (#536)
z2trillion Jun 16, 2023
d815e8d
Fix chain ID from a Word to Uint64. (#553)
silathdiir Jun 21, 2023
3432f28
[Fix]mpt root non consistent when accessing storage of a non-existed …
noel2004 Jun 21, 2023
90b591c
feat: update pi circuit to be compatible with the latest bridge contr…
kunxian-xia Jun 21, 2023
7c2942f
fix l1fee constraint (#557)
noel2004 Jun 21, 2023
fcf0381
refactor sig verify subcircuit (#538)
lispc Jun 21, 2023
d6aff8c
Fix: constant column of PI circuit is not fixed (#561)
kunxian-xia Jun 26, 2023
94b7637
fix l1 fee unittests (#562)
noel2004 Jun 26, 2023
2369316
big change! upgrade zktrie circuit (#548)
z2trillion Jun 27, 2023
196db5e
Feat: constrain tx data gas cost in RLP & Tx circuits (#566)
kunxian-xia Jun 28, 2023
e64e368
cargo fix (#570)
lispc Jun 28, 2023
25dd32a
remove chain_id in pi (#567)
kunxian-xia Jun 28, 2023
56c4bab
Re-enable mpt update lookups in test-heavy (#581)
z2trillion Jul 3, 2023
b85a2fe
Proof compression circuit (#568)
zhenfeizhang Jul 4, 2023
395b897
Update coinbase codehash to empty code hash if needed (#588)
z2trillion Jul 4, 2023
339a0fd
fix some clippy warning; update halo2 to develop (#591)
lispc Jul 4, 2023
f24a795
fix-bufferreader: constrain the "in-bound" selectors vs the addresses…
naure Jul 4, 2023
4cd5956
Precompile ECRECOVER (#529)
roynalnaruto Jul 4, 2023
695eb0a
Only call mock_fill_state_roots in super circuit tests (#593)
z2trillion Jul 5, 2023
b186b63
fix tx fee in end_tx (#599)
lispc Jul 6, 2023
a795815
Update super_circuit.rs
lispc Jul 6, 2023
49ad0cd
Re-use cells between mutually exclusive conditions (#601)
roynalnaruto Jul 7, 2023
ba4f7fe
feat: allow deploy contract at addr with non 0 balance (#606)
lispc Jul 11, 2023
4686a07
`BeginTx` check for init-code (#610)
roynalnaruto Jul 12, 2023
2a69a55
fix-tob-scroll-2: enforce both cases of RLC is_lt_128 (#615)
naure Jul 13, 2023
fc6c8a2
Memory opt with word look up (#466)
DreamWuGit Jul 17, 2023
8d67293
remove todo (#644)
DreamWuGit Jul 18, 2023
e6a6e33
feat(zktrie state): fix state rebuilding (#611)
lispc Jul 18, 2023
48b1f7d
fix gen_copy_steps_for_return_data (#646)
lightsing Jul 18, 2023
82fc8ae
Add better min_num_rows_block for mpt circuit (#639)
z2trillion Jul 18, 2023
d21b7b3
ECC Circuit: EcAdd, EcMul, EcPairing (#559)
roynalnaruto Jul 18, 2023
ac5f73e
`EcAdd` gadget (#598)
roynalnaruto Jul 19, 2023
b348d3f
`EcMul` gadget (#600)
darth-cy Jul 20, 2023
837a94f
remove ComparisonChip (#659)
naure Jul 20, 2023
c2c5ecc
fix: chain_id should not be imported from block.context (#664)
lispc Jul 22, 2023
925f6fc
Upgrade mpt-circut `v0.4`. (#666)
silathdiir Jul 22, 2023
a9ecb03
Add derived `Debug` to CompressionCircuit. (#668)
silathdiir Jul 24, 2023
156a3a5
fix accoute creation rw inside callop (#672)
lispc Jul 25, 2023
9cbbd35
copy-fix-terminate: secure termination (#649)
naure Jul 26, 2023
e9261c6
add withdraw_proof to MptUpdates (#678)
lispc Jul 27, 2023
69f4fe1
[fix] add precompile to access list (#676)
lightsing Jul 27, 2023
2caf508
`EcPairing` EVM Circuit Gadget (Valid Inputs) (#675)
roynalnaruto Jul 27, 2023
7e5675c
fix some testcases in testool related to copy table (#653)
lightsing Jul 27, 2023
1ed6efd
Feat: proof aggregation (#670)
zhenfeizhang Jul 28, 2023
60d7a4b
Move basic field config after RLC and Keccak config in aggregation-ci…
silathdiir Jul 28, 2023
7bca679
Update `snark-verifier` and `snark-verifier-sdk`. (#689)
silathdiir Jul 31, 2023
f05db90
[feat] Precompile MODEXP (#520)
noel2004 Aug 1, 2023
6deaabd
feat: refactor sig_circuit and ecc_circuit row capacity estimation (#…
darth-cy Aug 1, 2023
2b4e90d
full impl of PUSHn (#684)
lightsing Aug 1, 2023
5ae54f4
[feat] Update mpt and poseidon circuit with new hash scheme (#667)
noel2004 Aug 1, 2023
cb8d567
[feat] unify u8 u16 lookup table (#694)
lightsing Aug 2, 2023
aa177c0
opt min_num_rows_block in poseidon_circuit (#700)
noel2004 Aug 2, 2023
610f4f1
speedup ci using verify_at_rows (#703)
lispc Aug 2, 2023
dc5ffa0
update super circuit row estimation API (#695)
lispc Aug 2, 2023
f12d26c
remove num_of_chunks in aggregation circuit's instance column (#704)
lispc Aug 2, 2023
5fe2b3a
fix: lost tx_type when doing type conversion (#710)
kunxian-xia Aug 2, 2023
2855c13
fix condition (#708)
lightsing Aug 2, 2023
7b98e69
Upgrade `snark-verifier` to use `verify_evm_calldata` in scroll-prove…
silathdiir Aug 3, 2023
cd6f44f
fix: min_num_rows_block of pi_circuit (#716)
kunxian-xia Aug 3, 2023
87993f5
Upgrade snark-verifier to make `verify_evm_calldata` public. (#720)
silathdiir Aug 4, 2023
f2ce8f5
misc fix for mainnet (#717)
lispc Aug 4, 2023
06a5172
Feat: update the configuration params for sig circuit as we increase …
kunxian-xia Aug 4, 2023
8f3e82a
#711 + #713 remove num chunks from public input; relax the constraint…
zhenfeizhang Aug 4, 2023
76989b3
fix returndatacopy len (#724)
lispc Aug 4, 2023
c4db809
Fix: sig circuit's capacity checker does not take account of ecrecove…
kunxian-xia Aug 4, 2023
225db80
[Fix] Set l1fee to zero for l1msg (#714)
noel2004 Aug 5, 2023
c032268
`LastCalleeReturnDataLength` value for precompile calls (#723)
lispc Aug 5, 2023
5740543
[Fix] caller account not exist in l1msg (#729)
noel2004 Aug 5, 2023
2c8c749
add create2 deploy to non-zero balance address test (#727)
lightsing Aug 5, 2023
4748be6
nonce can skip
lispc Aug 6, 2023
8b29f74
nonce can skip
lispc Aug 7, 2023
70ccef7
fix sender_nonce vs tx_nonce handling inside begin tx (#731)
lispc Aug 7, 2023
d0e7a07
fix LtChip range check (#690)
lightsing Aug 7, 2023
fb86b74
Update create.rs
lispc Aug 7, 2023
faeced2
Gas Cost Checks for Precompile Calls (#696)
roynalnaruto Aug 8, 2023
106ccd5
Fix codehash phase; fix l1 tx nonce (#741)
lispc Aug 8, 2023
c1aacd9
address additional comments on #712 (#726)
zhenfeizhang Aug 9, 2023
d5ca004
ZELLIC-ZK1-1: fix typo in multiplied terms (#718)
naure Aug 9, 2023
3a8f950
rename end_offset (#747)
naure Aug 9, 2023
d383d23
fix: endianness (Fq) | lookup (word v keccak) | dev load (#755)
roynalnaruto Aug 10, 2023
9b46ddb
fix: constraint for parity-check gadget's a==2 (#738)
roynalnaruto Aug 10, 2023
697893f
`EccCircuit` (related to `EcPairing`) multiple fixes (#756)
roynalnaruto Aug 11, 2023
66d5462
[refactor] using rws step for callop/create/return_revert/sha3 (#740)
lightsing Aug 11, 2023
fbe68ec
[Feat]l2 geth util: use l2geth to generate exec trace for unittest (#…
noel2004 Aug 11, 2023
bc1a667
[refactor] extract From/To Gadget (#734)
lightsing Aug 12, 2023
8e80411
fix TOB-SCROLL-6 (#709)
DreamWuGit Aug 14, 2023
267865d
fix Zellic 3.7 (#681)
DreamWuGit Aug 14, 2023
9beba68
upgrade halo2 to better detect phase bug (#761)
lispc Aug 14, 2023
48172be
fix TOB-SCROLL-14 (#661)
DreamWuGit Aug 14, 2023
799450c
fix TOB-SCROLL2-8 The Invalid Creation error handling circuit is unco…
DreamWuGit Aug 14, 2023
90ca1fc
fix TOB-SCROLL-13: fix unconstrained opcodes allow nondeterministic e…
DreamWuGit Aug 14, 2023
55b04c4
flag1 = num_valid_snarks < 5
kunxian-xia Aug 8, 2023
16827b9
agg circuit: More verbose agg debugging; checks pairing during circui…
zhenfeizhang Aug 12, 2023
9a3fbf3
Release v0.5.x allow skip l1msg (#760)
lispc Aug 13, 2023
3c4758f
fix l1 queue index when WitnessBlock constains multiple eth blocks
lispc Aug 13, 2023
df2c0e6
fix calldatasize inside create (#753)
lispc Aug 10, 2023
e40ab9e
[feat] add constraint annotations api (#762)
lightsing Aug 14, 2023
2e2fa59
return_revert: Enforce REVERT reversions (#736)
DreamWuGit Aug 15, 2023
7ce566e
[fix] l1fee of end_tx (#763)
lightsing Aug 15, 2023
57b9488
[fix] end_tx when handle l1fee oracle update tx (#769)
lightsing Aug 15, 2023
2eeeb75
[fix] fix tx fee in end_tx (#773)
lightsing Aug 15, 2023
d0fed22
`FpConfig` to be finalized in ECC circuit post each phase (#758)
roynalnaruto Aug 15, 2023
4c8e9f5
constrain not success when revert (#770)
DreamWuGit Aug 16, 2023
19d3b73
refactor callop: rwc & gas (#774)
lispc Aug 16, 2023
cb664f9
fix returndata for precompile failed
lispc Aug 14, 2023
4c0bbb7
fix LastCalleeId for call empty
lispc Aug 14, 2023
b20bed2
fix ZELLIC-ZK1-4 Missing range checks in MulAdd chip (#685)
lightsing Aug 16, 2023
1cdfef4
Fix: allow skipping of L1Msg tx part 2 (calculate num_all_txs in tx c…
kunxian-xia Aug 16, 2023
2e42287
Fix the bugs in RLP/Tx/PI circuit which are reported by Zellic & KALO…
kunxian-xia Aug 16, 2023
964ae09
fix: assert pk is on curve (#781)
roynalnaruto Aug 16, 2023
1d190ba
refactor: remove keccak constants from aggregator (#752)
darth-cy Aug 17, 2023
e624107
refactor and fix (#783)
lightsing Aug 17, 2023
87a20e1
add evm&state circuit doc (#784)
DreamWuGit Aug 17, 2023
c9c1bb4
[fix] testool case empty calldata (#785)
lightsing Aug 17, 2023
4b5eadb
Fix to set `is_call` to calculate gas cost in error-oog-call gadget, …
silathdiir Aug 17, 2023
e709d84
fix stack err for return revert (#788)
lispc Aug 17, 2023
a89e567
Fix test tool test: call precompile with insufficient balance (#787)
DreamWuGit Aug 17, 2023
8bc9812
fix: must not use next tx's tlpb to assign cur tx's tlpb (#789)
kunxian-xia Aug 18, 2023
750169c
fix: constraint on num_all_txs_acc' is wrong (#790)
kunxian-xia Aug 18, 2023
76c6a7b
refactor return data (#797)
lispc Aug 21, 2023
d3ffb46
fix gascost in modexp (#796)
noel2004 Aug 21, 2023
7834cc6
fix first byte (#802)
DreamWuGit Aug 21, 2023
2773896
Refactor: make witness gen of tx circuit more easier to maintain (#800)
kunxian-xia Aug 21, 2023
0a2a602
(1) testool: use cache skip success cases (2) testool enable parallel…
lightsing Aug 21, 2023
1093f5e
Release v0.6.x (#792)
lispc Aug 21, 2023
a690843
add four circuit doc (#806)
DreamWuGit Aug 22, 2023
cb29829
fix test tool create collision tests (#793)
DreamWuGit Aug 22, 2023
ae17cf5
Remove CopyDataType::Precompile (#809)
naure Aug 23, 2023
b163427
fix testool and update codehash (#805)
lightsing Aug 23, 2023
cb5faa5
fix blockhash in test tool (#810)
DreamWuGit Aug 23, 2023
90d0c70
fix returndata for err cases; upgrade evm tests submodule (#813)
lispc Aug 23, 2023
551bcc2
more strict check on Account Rw (#819)
lispc Aug 24, 2023
63725d4
better ccc: add num_poseidon_rows and num_vertical_rows
lispc Aug 22, 2023
fc53106
cherry-pick pr#807 (#808)
kunxian-xia Aug 22, 2023
784dac5
testool: enable more tests
lispc Aug 24, 2023
015018b
clippy
lispc Aug 24, 2023
3783df7
clippy
lispc Aug 24, 2023
2a6cc04
[Feat] make supercircuit test applying l2trace (#767)
noel2004 Aug 25, 2023
956059f
fix code_size in create; fix return_data for call oog
lispc Aug 25, 2023
4a043fc
scroll mode for testool (#822)
lispc Aug 27, 2023
1ed56e3
improve testool for scroll mode (#831)
lispc Aug 27, 2023
8d3fdcd
respect tx_num limit in ccc (#828)
lispc Aug 26, 2023
a74ba42
update_account_from_proofs: insert Account::zero if feasible
lispc Aug 28, 2023
2058695
bus-mapping: more robust trace handling when stack underflow
lispc Aug 28, 2023
237e2f2
fix CallContextField::GasLeft (#833)
lispc Aug 28, 2023
0258c27
Handle precompile call failure `call.is_success == false` due to "Inv…
roynalnaruto Aug 28, 2023
7e69b03
chore: remove redundant branch (#835)
roynalnaruto Aug 28, 2023
4a88495
add pi, sig, modexp doc (#836)
DreamWuGit Aug 28, 2023
7c48935
testool: enable stZeroKnowledge tests (#839)
lispc Aug 29, 2023
517127f
upgrade "misc-precompiled-circuits" and handle modexp invalid len in …
lispc Aug 29, 2023
5134be1
testool: support sub circuit; fix modexp row usage (#841)
lispc Aug 29, 2023
c57dc3a
testool: support all precompiles (#843)
lispc Aug 29, 2023
82b381d
Swap only if both G1, G2 are 0s from EVM (#845)
roynalnaruto Aug 29, 2023
15f90f3
dep: pairing cost is buggy in revm (#844)
kunxian-xia Aug 29, 2023
c34c889
Fix EXTCODECOPY with empty account (#846)
lispc Aug 29, 2023
2691944
allow n_pairs to have a larger range (#847)
kunxian-xia Aug 29, 2023
bcd9251
Fix: n_padded_zeroes must be less than 192. (#849)
kunxian-xia Aug 29, 2023
80496c1
Precompile (non-static) calls with (non-zero) value (#848)
roynalnaruto Aug 30, 2023
f16dc37
testool: enable all tests
lispc Aug 30, 2023
bc51259
fix-exp-is-last: enforce the secure termination of Exp circuit (#837)
naure Aug 30, 2023
d2a241c
upgrade mpt circuit; some other minor changes (#851)
lispc Aug 30, 2023
7a30b79
Fix/rws limit early stop (#852)
lispc Aug 30, 2023
639cbb0
feat(testool): use list to filter tests; upgrade revm to fix modexp g…
lispc Aug 30, 2023
c6b022c
test self_destruct for oog &basefee expected invalid opcode (#854)
DreamWuGit Aug 30, 2023
44e99cb
Reversion from Precompile calls (even from begin_tx) (#855)
roynalnaruto Aug 31, 2023
52a4796
fix (#858)
kunxian-xia Aug 31, 2023
10b47e3
Refactor and extract pairing-check code to a function `extract_proof_…
silathdiir Aug 31, 2023
1604a71
Clean mod exp codes (#859)
lispc Aug 31, 2023
b0b58df
add modexp all zeros test (#861)
DreamWuGit Aug 31, 2023
47acbf5
pi circuit: add sanity check for state_root/coinbase/difficulty (#824)
kunxian-xia Aug 31, 2023
ed59d0f
Fix: post state check should fail for hash precompile tests (#856)
kunxian-xia Aug 31, 2023
fb9efcd
fix pi circuit env var reading (#864)
lispc Aug 31, 2023
bcb3eb6
add 0xfe invalid code test (#863)
DreamWuGit Aug 31, 2023
d8ffd95
fix(ecMul): handle case for P == -R (#865)
roynalnaruto Aug 31, 2023
e7d4c10
make row estimation of tx and pi circuits more precise (#866)
kunxian-xia Sep 1, 2023
0ee3c5e
Feat: bump up poseidon-circuit to enable parallel synthesis (#867)
kunxian-xia Sep 1, 2023
4bf0777
bump l2geth; support sig circuit in testool (#869)
lispc Sep 1, 2023
887f60c
add more tests for modexp (#870)
DreamWuGit Sep 1, 2023
89e7511
ec pairing simplify (#873)
roynalnaruto Sep 2, 2023
3d6e79a
refactor: update the default sign_data (#560)
kunxian-xia Sep 2, 2023
d597183
fix issue with msg_hash = 0 (#872)
zhenfeizhang Sep 2, 2023
13aaee3
do not use region_index to ref a cell (#874)
kunxian-xia Sep 2, 2023
47236ff
rewrite geth_utils with go.work (#875)
lispc Sep 2, 2023
6a23b0a
fix(trace): add base fee (#877)
lispc Sep 2, 2023
7b3f9cd
testool: better handling of parallelism (#879)
lispc Sep 2, 2023
a868e37
feat: check post tx account (#878)
lispc Sep 2, 2023
c8f7ce2
test: don't use l1 tx in tracing (#886)
lispc Sep 3, 2023
4e9d8d2
optim-evm-selectors: move state_selector multiplication (#857)
naure Sep 4, 2023
c41bb7a
upgrade halo2-lib to fix ec pairing (#889)
lispc Sep 4, 2023
fba2a58
fix bug in #872 fix/msg-hash-zero (#880)
zhenfeizhang Sep 4, 2023
dcbebfc
add opcodes for evm circuit doc (#891)
DreamWuGit Sep 4, 2023
faf1514
fix(ecmul): support -1 * (0,0) (#895)
lispc Sep 5, 2023
feeebfa
fix: load constants wherever applicable (#892)
roynalnaruto Sep 5, 2023
6a44c95
improve poseidon ccc log (#896)
lispc Sep 5, 2023
991bff8
change BYTECODE_TABLE_LOOKUPS to 8 (#899)
lispc Sep 5, 2023
a88264d
add binary constraint (#902)
zhenfeizhang Sep 5, 2023
67e0ba5
fix tob-wave3-week3 (#904)
zhenfeizhang Sep 6, 2023
86491c2
minor refactor of testool (#907)
lispc Sep 6, 2023
48d9298
support max snark up to 15 (#803)
zhenfeizhang Sep 6, 2023
b0fd63e
FEAT: parallelize witness assignment of state circuit using assign_re…
Velaciela Sep 6, 2023
fd703cc
fix calldataload when tx.to = null (#909)
lispc Sep 6, 2023
839aa62
Fix: test state degree 19->17 (#910)
lispc Sep 6, 2023
32d84e2
test: calldataload/calldatasize/calldatacopy inside deployment (#913)
DreamWuGit Sep 7, 2023
9c43410
fix end_tx soundness (#916)
lispc Sep 7, 2023
83b4d3b
Add common functions of `prover` from scroll-prover. (#893)
silathdiir Sep 7, 2023
75b3827
constrain log memory address (#920)
DreamWuGit Sep 9, 2023
8ae5d35
[feat] prestate tracer (#914)
lightsing Sep 9, 2023
95f8276
refactor(bus-mapping): spit begin end tx to another file (#922)
lispc Sep 10, 2023
25c5810
feat: add inner-prove and chunk-prove to testool (#921)
silathdiir Sep 10, 2023
4a696e2
opt(assignment): only do 3rd phase assignment for evm circuit in supe…
lispc Sep 11, 2023
65225ad
sanity check: keccak rows == 12 in super circuit
lispc Sep 11, 2023
bce856a
Fix to `<=` row-limit when `add` row. (#925)
silathdiir Sep 11, 2023
cd69884
fix: validate chain ID when generates witness block (#927)
silathdiir Sep 11, 2023
bd32d4c
add "" to default codedb (#929)
lispc Sep 11, 2023
1b2a410
wip: preliminary work sig circuit/lookp
roynalnaruto Sep 11, 2023
f712e3f
Merge branch 'develop' into fix/ecrecover-soundness
roynalnaruto Sep 11, 2023
caf9403
feat: handle panics and edge cases in sig circuit
roynalnaruto Sep 11, 2023
c095051
fix: handle v not boolean
roynalnaruto Sep 11, 2023
bb05086
fix: fq modulus not assigned and bus-mapping handle overflowing r/s
roynalnaruto Sep 11, 2023
cdc9ab5
Bug fix: fixed part of tx table must have is_calldata = false (#935)
kunxian-xia Sep 12, 2023
60c9d2a
fix: add analysis function `print_evm_circuit_row_usage` and `print_r…
silathdiir Sep 12, 2023
bf46ab3
fix: sig_v handle invalid values (lookup) and is_valid dev_load fix
roynalnaruto Sep 12, 2023
570dd5b
fix ecdsa circuit binary selection bug (#931)
zhenfeizhang Sep 12, 2023
47ff003
Replace `dotenv` with `dotenvy`. (#934)
silathdiir Sep 12, 2023
fb3533f
Merge branch 'develop' into fix/ecrecover-soundness
roynalnaruto Sep 12, 2023
30c89d3
refactor (review comment)
roynalnaruto Sep 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[target.'cfg(target_os="macos")']
rustflags = ["-C", "link-args=-framework CoreFoundation -framework Security"]
[net]
git-fetch-with-cli = true
[env]
RUST_MIN_STACK = "16777216"
48 changes: 37 additions & 11 deletions .github/ciChecksScripts/wakeUpRunner.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,49 @@
#!/bin/bash

profile="cirunner"
runner_vpc_id="vpc-08ac0db4d8a7cce9e"
runner_vpc_id1="vpc-8bdf97ec"
runner_vpc_id2="vpc-1176d875"
region_opt="--region us-west-2"

# Get runner status
runner=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[ci-checks-runner] Name=network-interface.vpc-id,Values=[$runner_vpc_id] --query "Reservations[*].Instances[*][InstanceId]" --output text | xargs)
runner1=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[jenkins] Name=network-interface.vpc-id,Values=[$runner_vpc_id1] --query "Reservations[*].Instances[*][InstanceId]" ${region_opt} --output text | xargs)
runner2=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[jenkins] Name=network-interface.vpc-id,Values=[$runner_vpc_id2] --query "Reservations[*].Instances[*][InstanceId]" --output text | xargs)

{
while true; do
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner1 --query "Reservations[*].Instances[*].State.[Name]" ${region_opt} --output text)
echo 'runner1 - '$runner_status
if [[ $runner_status = "stopped" ]]; then
aws ec2 start-instances --profile $profile --instance-ids $runner1 ${region_opt}
break
elif [[ $runner_status = "running" ]]; then
echo 'waiting for runner1 restore'
sleep 30
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner1 --query "Reservations[*].Instances[*].State.[Name]" ${region_opt} --output text)
if [[ $runner_status = "running" ]]; then
break
fi
else
sleep 30
fi
done
}&
while true; do
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner --query "Reservations[*].Instances[*].State.[Name]" --output text)
if [ $runner_status = "stopped" ]; then
aws ec2 start-instances --profile $profile --instance-ids $runner
exit 0
elif [ $runner_status = "running" ]; then
sleep 120
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner --query "Reservations[*].Instances[*].State.[Name]" --output text)
if [ $runner_status = "running" ]; then
exit 0
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner2 --query "Reservations[*].Instances[*].State.[Name]" --output text)
echo 'runner2 - '$runner_status
if [[ $runner_status = "stopped" ]]; then
aws ec2 start-instances --profile $profile --instance-ids $runner2
break
elif [[ $runner_status = "running" ]]; then
echo 'waiting for runner2 restore'
sleep 30
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner2 --query "Reservations[*].Instances[*].State.[Name]" --output text)
if [[ $runner_status = "running" ]]; then
break
fi
else
sleep 30
fi
done

exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from pprint import pprint
import reporting_modules as rmod

env = json.load(open('/home/ubuntu/env.json'))
cstats = '/home/ubuntu/cpu.stats'
mstats = '/home/ubuntu/mem.stats'
env = json.load(open('/home/CI/env.json'))
cstats = '/home/CI/cpu.stats'
mstats = '/home/CI/mem.stats'

def main():
parser = argparse.ArgumentParser(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def log_processor(pull_request,circuit, degree):
SETUP_PREFIX = "[Setup generation]"
PROOFGEN_PREFIX = "[Proof generation]"
PROOFVER_PREFIX = "[Proof verification]"
logfile = [i for i in os.listdir('/home/ubuntu/') if 'proverlog' in i][0]
f = open(f'/home/ubuntu/{logfile}', 'r')
logfile = [i for i in os.listdir('/home/CI/') if 'proverlog' in i][0]
f = open(f'/home/CI/{logfile}', 'r')
logdata = f.read()
logdata = logdata.split("\n")
running = [i for i in logdata if 'running' in i and 'test' in i][0].split()[1]
Expand Down
2 changes: 1 addition & 1 deletion .github/proverCiScripts/deployToProver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#set -x

prnumber=$1
base_dir="/home/ubuntu/CI_Prover_Benches/"
base_dir="/home/CI/CI_Prover_Benches/"
target_dir="$base_dir"PR"$1"

source_dir=$2
Expand Down
2 changes: 1 addition & 1 deletion .github/proverCiScripts/execBench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
#set -x

prnumber=$1
base_dir="/home/ubuntu/CI_Prover_Benches/"
base_dir="/home/CI/CI_Prover_Benches/"
target_dir="$base_dir"PR"$1"
k=$2
circuit=$(echo $3 | awk '{ print $2 }' | tr '[:upper:]' '[:lower:]')
Expand Down
2 changes: 1 addition & 1 deletion .github/proverCiScripts/getSysstat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
#set -x

prnumber=$1
base_dir="/home/ubuntu/CI_Prover_Benches/"
base_dir="/home/CI/CI_Prover_Benches/"
target_dir="$base_dir"PR"$prnumber"

logfile=$(ls $target_dir | grep proverlog | xargs -n 1 basename)
Expand Down
2 changes: 1 addition & 1 deletion .github/proverCiScripts/injectHalo2Revision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#set -x

prnumber=$1
base_dir="/home/ubuntu/CI_Prover_Benches/"
base_dir="/home/CI/CI_Prover_Benches/"
target_dir="$base_dir"PR"$1"

_revision=$2
Expand Down
2 changes: 1 addition & 1 deletion .github/proverCiScripts/prepareProver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#set -x

prnumber=$1
base_dir="/home/ubuntu/CI_Prover_Benches/"
base_dir="/home/CI/CI_Prover_Benches/"
target_dir="$base_dir"PR"$1"
source_dir=$2

Expand Down
2 changes: 1 addition & 1 deletion .github/proverCiScripts/processResults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
prnumber=$1
label=$2
degree=$3
base_dir="/home/ubuntu/CI_Prover_Benches/"
base_dir="/home/CI/CI_Prover_Benches/"
target_dir="$base_dir"PR"$prnumber"

rm -f ~/*.stats
Expand Down
2 changes: 1 addition & 1 deletion .github/proverCiScripts/shutdownProver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#set -x

profile="cirunner"
provers_vpc_id="vpc-09fb44da782f32abb"
provers_vpc_id="vpc-1176d875"

running_prover=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[proverbench-multiAZ] Name=instance-state-name,Values=[running] Name=network-interface.vpc-id,Values=[$provers_vpc_id] --query "Reservations[*].Instances[*][InstanceId]" --output text)

Expand Down
12 changes: 6 additions & 6 deletions .github/proverCiScripts/wakeUpProver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
#set -x

profile="cirunner"
provers_vpc_id="vpc-09fb44da782f32abb"
provers_vpc_id="vpc-1176d875"
dns_ipaddr=$(dig prover.cirunners.internal +short)
zone_id=$(aws route53 --profile $profile list-hosted-zones --query 'HostedZones[?Name==`cirunners.internal.`].[Id]' --output text | awk -F \/ '{ print $3 }')
route53_dir=".github/proverCiScripts/misc"

sshprover () {
ssh -o ConnectTimeout=5 prover
ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no prover "uptime"
}

# Get running provers IDs
provers_running=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[proverbench-multiAZ] Name=instance-state-name,Values=[running] Name=network-interface.vpc-id,Values=[$provers_vpc_id] --query "Reservations[*].Instances[*][InstanceId]" --output text)
provers_running_num=$(echo $provers_running | wc -w)

if [ $provers_running_num -gt 1 ]; then
if [[ $provers_running_num -gt 1 ]]; then
echo "More than 1 provers running"
exit 1
elif [ $provers_running_num -eq 0 ]; then
elif [[ $provers_running_num -eq 0 ]]; then
# Get provers IDs and start first available
provers=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[proverbench-multiAZ] Name=network-interface.vpc-id,Values=[$provers_vpc_id] --query "Reservations[*].Instances[*][InstanceId]" --output text | xargs)
else
Expand All @@ -28,7 +28,7 @@ else
fi

for prover in $provers; do
[ ! -z $single_prover_running ] || aws ec2 start-instances --profile $profile --instance-ids $prover
[[ ! -z $single_prover_running ]] || aws ec2 start-instances --profile $profile --instance-ids $prover
if [ $? -eq 0 ]; then
ipaddr=$(aws ec2 describe-instances --profile $profile --instance-ids $prover --query "Reservations[*].Instances[*].NetworkInterfaces[*].[PrivateIpAddress]" --output text)
if [ $ipaddr != $dns_ipaddr ]; then
Expand All @@ -38,7 +38,7 @@ for prover in $provers; do
aws route53 change-resource-record-sets --profile $profile --hosted-zone-id $zone_id --change-batch file://$route53_dir/route53.template.json
sleep 61
rm $route53_dir/route53.template.json
ssh-keygen -f "/home/ubuntu/.ssh/known_hosts" -R "prover.cirunners.internal"
ssh-keygen -f "/home/CI/.ssh/known_hosts" -R "prover.cirunners.internal"
fi
break
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ProverBenchFromHalo2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- run: echo "halo2 PR ${{ env.HALO2PR }} submitted by ${{ env.GH_USER }}"
- run: echo "Running prover benchmarking due to ${{ github.event.inputs.event-type }}."
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: 'halo2benchmarking'
- run: .github/proverCiScripts/wakeUpProver.sh
Expand Down
Loading
Loading