Commit Graph

6942 Commits

Author SHA1 Message Date
aggstam
95434701f4 blockchain/Block: block version to derive from cuttof slot, not hardcoded value 2023-10-03 16:38:30 +03:00
aggstam
f7f8214988 contract/money/pow_reward: minor renaming 2023-10-03 16:31:02 +03:00
aggstam
030cbb48c9 validator/verification: validate producer signature using transaction public key 2023-10-03 16:25:29 +03:00
Dastan-glitch
02a2a1587c bin/tau: [WIP] add tau-python frontend 2023-10-02 16:56:35 +03:00
Dastan-glitch
9e7042c361 bin/tau: have the params as object in add() 2023-10-02 16:53:36 +03:00
x
cd15f71e3f rename multisig.sage to escrow.sage 2023-09-29 14:19:03 +02:00
aggstam
b26106ffe7 validator/pow: stoppable mining 2023-09-28 16:50:18 +03:00
ertosns
08b39b9462 [doc/architecture] consensus contracts spec 2023-09-27 22:53:08 +03:00
ertosns
f0ba9ad0f0 [research/mpc] add testbeaver, miscel changes in mpc api 2023-09-27 22:53:08 +03:00
ertosns
e1c7b4c0ea [research/bulletproof-mpc] complete mpc-bulletproof 2023-09-27 22:53:08 +03:00
Dastan-glitch
343c319228 bin/tau: rename update() to modify() 2023-09-22 06:25:40 +03:00
Dastan-glitch
a13b5f36a9 bin/tau: fix update() method 2023-09-22 06:17:52 +03:00
Dastan-glitch
bd82d1c850 bin/tau: task IDs to be local instead of being written in task itself, and use refids instead 2023-09-22 05:54:16 +03:00
aggstam
214a4f458d darkfid2: (very) raw miner task added 2023-09-21 18:40:15 +03:00
ertosns
41e275b3ed [research/bulletproof-mpc] testing mpc ipp 2023-09-21 16:19:15 +03:00
ertosns
27e9d70c85 [research/buletproof-mpc] implement bulletproof over mpc] 2023-09-21 16:19:15 +03:00
ertosns
a12edcefe7 [research/mpc] miscel change to mpc 2023-09-21 16:19:15 +03:00
ertosns
d35942e566 [research/mpc] inner product over mpc, test msm 2023-09-21 16:19:15 +03:00
ertosns
44514a3474 [research/mpc] fix leaked shares in mul, msm 2023-09-21 16:19:15 +03:00
ertosns
5eff0dc864 [research/mpc] fix scalar_share multiplication 2023-09-21 16:19:15 +03:00
aggstam
ad584f24c7 Cargo.toml: unresolved import fixed 2023-09-21 01:19:53 +03:00
aggstam
10fbf5d963 validator: pow module added for mining 2023-09-20 23:32:33 +03:00
y
82b9ab914e fuzz: add zkas_compile.rs libfuzzer fuzz harness
This should have been done in an earlier commit
(a0e78b576a)
but I forgot to add the file.
2023-09-19 16:16:02 -04:00
y
cd3334806d fuzz: add code coverage artifacts to ignore file 2023-09-19 16:15:49 -04:00
y
2d41e54f14 fuzz: move all artifacts into regressions
Merge the libfuzzer and honggfuzz saved crash inputs into a shared
folder in fuzz/regressions

Add relevant entries to .gitignore
2023-09-19 16:13:50 -04:00
y
e7a7f6d02d fuzz: add regressions/ folder; improve READMEs 2023-09-19 16:09:22 -04:00
y
aaed928482 fuzz: cleanup zkas-compile harness in honggfuzz 2023-09-19 14:44:03 -04:00
y
a0e78b576a fuzz: Enable and document code coverage for zkas
Libfuzzer has more capabilities to provide a helpful code coverage
report for fuzz testing. (Or at least is has better documentation.)
This commit copies the zkas-compile harness from honggfuzz into libfuzzer.
It also includes instructions for generating coverage reports.
2023-09-19 14:41:25 -04:00
aggstam
989d049452 blockchain/Block: proper hash usage 2023-09-19 16:54:35 +03:00
aggstam
e5081d55ce blockchain/Block: refactored in preparation for mining integration 2023-09-19 00:11:20 +03:00
aggstam
7ee02b6f7d script/research/pow: changed nonce to pallas::Base 2023-09-18 21:09:59 +03:00
aggstam
6bcdfd3f87 blockchain/Block: magic be gone 2023-09-18 20:13:58 +03:00
Dastan-glitch
e6e724bccf doc: revert darkirc back to ircd 2023-09-18 19:41:47 +03:00
y
6c1002a1ba timekeeper: improve wording about fields set to 0 2023-09-18 15:46:05 +00:00
y
63a6856ccd timekeeper: restore 0 check for slot 2023-09-18 15:46:05 +00:00
y
f67fc3df29 Add checks on TimeKeeperSafe methods 2023-09-18 15:46:05 +00:00
y
f85cd257a0 fix mistake in TimeKeeperSafe::current 2023-09-18 15:46:05 +00:00
y
6308a7e123 fix comments 2023-09-18 15:46:05 +00:00
y
5d62a10855 Add TimeKeeperSafe struct
Instead of checking if one of the TimeKeeper fields is 0 on every
operation (which adds overhead and protects only in the case of an
incoherent instantiation of the struct), add a new struct TimeKeeperSafe
that panics when created with bad values.

It is still possible that a developer can make a mistake and manually
initialize a TimeKeeper with bad values or else set its fields to bad
values. For now, we will accept this risk as it is not present in the
codebase.
2023-09-18 15:46:05 +00:00
y
c7814711e0 fmt 2023-09-18 15:46:05 +00:00
y
2f45588f57 util: fix division-by-zero panics
Added simple checks for division by zero in arithmetic operations in
util/time.rs
Added a unit test to check that a TimeKeeper with values of 0 in its
fields can call its methods without panicking.
2023-09-18 15:46:05 +00:00
y
0a61ec37fb zkas: fix panic occurring in nested function calls
This issue was discovered by fuzzing.

Change the `unimplemented()!` panic macro to error handling that informs
the user that using Literals and Functions in nested function calls is
not yet supported. This should be a slightly more friendly developer
experience. Changing this from a panic to an error allows us to continue
with further fuzzing.
2023-09-18 11:04:20 +00:00
y
3b52ed4e27 zkas: formatting, typos, clippy 2023-09-18 11:04:20 +00:00
y
8a333100ef zkas: fix panic in Analyzer
This issue was discovered with fuzzing.

Panic 1: It was possible to assign a variable to a function/opcode with
no return type. This caused a index-out-of-bounds panic when the
analyzer attempted to access the first element of an empty vector of
return types. The analyzer now presents an error when a .zk author
attempts to assign a variable to an opcode that has no return types.

Panic 2: There was an index-out-of-bounds panic when performing
verification on Literals that were passed to Opcodes that use Array
types as their arguments. This was fixed by pasting the validation code
from the Variable verfication section which handles Arrays properly.
(Refactoring should be done to reduce duplication here.)
2023-09-18 11:04:20 +00:00
x
01a1ade3b6 doc: split SUMMARY.md into sections 2023-09-17 14:25:22 +02:00
y
827ddbb9a0 zkas: fix more panics in Parser
These issues were found via fuzzing

Panic 1: If the size of the vector of tokens passed to
`check_section_structure` is less than 2, the parser tells
the author that there are not enough valid tokens in the section.

Panic 2: Very large values of k will result in integer overflow when the
value is larger than the type's MAX_SIZE. This causes the existing k <=
16 check to succeed but it actually shouldn't. In debug/fuzzing
   contexts, Rust panics. In production, this will not occur.

Panic 3: If invalid/unimplemented characters appear in an argument to a function, the
parser panicked when it hit `unimplemented!()`. Now it tells the author
that this character cannot be used in an argument to a function.
2023-09-17 00:18:15 +00:00
y
d7816326fb zkas: fix panics in Parser
Add error handling for the parser logic. Both of these issues were found
via fuzzing.

Fix Panic 1: instead of panicking via unwrap() when analyzing the namespace,
the parser displays an error message informing the .zk file author
that they need to add a namespace.

Fix Panic 2: if the length of the `tokens` vector is 0, the parser
now displays an error saying so.
2023-09-16 23:14:31 +00:00
y
c669ba4696 fuzz: fix old code comment in script 2023-09-16 23:00:24 +00:00
y
f9ed0b825c fuzz: add script to generate .zk file corpus 2023-09-16 23:00:24 +00:00
y
9d97aebf50 fuzz: Add fuzz harness for zkas compilation
Create a fuzz harness to test the ./zkas binary compilation process. The
whole pipeline is tested: Lexer, Parser, Compiler, Analyzer. This is
performed by copying the relevant code from bin/zkas/src/main.rs.

Testing the entire pipeline like this is not very efficient in terms of
fuzzing cycles but on the other hand it is a quick-and-dirty way to find
results. It also benefits from testing the actual inputs to the binary
in the way it's expecting, rather than checking each of the components
in a piecemeal way using interfaces that aren't expected to be exposed
anyway.
2023-09-16 23:00:24 +00:00