Commit Graph

202 Commits

Author SHA1 Message Date
Csaba Kiraly ed0145921c
por: print keys for test vector generation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-06-12 03:47:10 +02:00
Csaba Kiraly 9456aad233
por: reduce s and challenge size for test vector generation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-06-09 02:31:48 +02:00
Csaba Kiraly f3baf18fe7
por: add hex print of PoR values
this is for debugging, not to be merged in its current form

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-06-09 02:30:39 +02:00
Csaba Kiraly 64b7020549
Merge branch 'storageproofs-constantine' into arm64
# Conflicts:
#	.gitmodules
#	dagger/por/backends/backend_blst.nim
#	dagger/por/backends/backend_constantine.nim
2022-05-18 22:40:52 +02:00
Csaba Kiraly 9577e2c463
enable build on Mac M1
- On Mac, -march=native is only supported in newest Clang versions,
better disable it for now.

- Bumping Leopard version to one that support arm64

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-05-17 16:27:59 +02:00
Dmitriy Ryajov d669e344bc
Engine (#89)
* rework discovery with async queues

* increase max message size for large manifests

* increase sleep time to 100 millis

* pass config

* check for nil on start/stop

* fix tests and split out discovery tests

* don't auto mount network

* add discovery tests

* rework moc discovery

* move discovery moc to disc dir

* don't force logging syncs

* don't force moc discovery on all tests

* rework discovery with methods

* add top level utils file

* don't use asyncCheck

* don't pass entire blocks to list blocks calback

* spelling

* - don't send want reqs to peers reporting the cid

- Don't request blocks directly on presense update, use `requestBlock`

* bug, nodes should not have blocks in local store

* Add failing test

* prefetch blocks so that download isn't serial

* if request already pending, return the handle

* fire discovery if no peers report block as have

* only query discovery if not enough nodes for cid

* wrap async req in template

* use non awaiting version of queue routines

* rework E2E tests as unittest

* re-add chronicles sinks

Co-authored-by: Tanguy <tanguy@status.im>
2022-05-12 15:52:03 -06:00
Dmitriy Ryajov 9ca4f90cf3
safe tables access (#95)
* safer table access

* use withValue
2022-05-12 14:23:05 -06:00
Dmitriy Ryajov cf062670f6
rename addOrAwait to getWantHandle (#97) 2022-05-12 14:09:40 -06:00
Dmitriy Ryajov 46197f957b
add onblock callback to list blocks visitor (#96)
* add onblock callback to list blocks visitor

* tests for listBlocks

* remove legacy blockList
2022-05-12 14:02:30 -06:00
Michael Bradley c2d7fe3fd7
[ci] generate coverage data and upload to Codecov (#93) 2022-05-10 14:41:44 -06:00
Csaba Kiraly 95c543f6e0
enabling PoR over BN254 curves
To enable the use of BN254, change the value of
`C` in backend_constantine.nim to `BN254_Snarks`

This also requires https://github.com/mratsim/constantine/pull/193

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-05-04 16:11:58 +02:00
markspanbroek d8ed4257df
[contracts] Make contract interactions optional in the node (#91)
Adds --eth-deployment parameter.
Does not crash when deployment json is missing or incorrect.
2022-04-25 15:12:37 +02:00
Mark Spanbroek c93e015e43 Disable logging in tests
Logger output interferes with the test runner output.
2022-04-21 14:04:07 +02:00
Mark Spanbroek fae05fce86 [contracts] Do not crash when contract interaction fails
Log error instead.
2022-04-21 14:04:07 +02:00
Mark Spanbroek d2da225f21 Update nim-ethers to 0.1.5 2022-04-21 14:04:07 +02:00
Mark Spanbroek 59f75fc540 [contracts] Start contract interactions when node starts 2022-04-21 14:04:07 +02:00
Mark Spanbroek 142ddd0fd3 [contracts] Use command line parameters for ContractInteractions 2022-04-21 14:04:07 +02:00
Mark Spanbroek 0738606303 [contracts] Add ContractInteractions to dagger node 2022-04-21 14:04:07 +02:00
Mark Spanbroek 9cbf6d0b6c [contracts] ContractInteractions wraps purchasing, sales and proving 2022-04-21 14:04:07 +02:00
Tanguy ce59dbd4a2
Revert "Cleanup engine and rework discovery (#87)"
This reverts commit 4740ffc144.
2022-04-20 14:28:11 +02:00
Dmitriy Ryajov 4740ffc144
Cleanup engine and rework discovery (#87)
* rework discovery with async queues

* misc style changes

* increase max message size for large manifests

* use upraises and avoid exceptions on key access

* increase sleep time to 100 millis

* pass config

* make list blocks trigger a callback on each block

* check for nil on start/stop

* fix tests and split out discovery tests

* don't auto mount network

* add list block tests

* add discovery tests

* rework moc discovery

* move discovery moc to disc dir

* don't force logging syncs

* don't force moc discovery on all tests

* rework discovery with methods

* add top level utils file

* don't use asyncCheck

* don't pass entire blocks to list blocks calback

* spelling
2022-04-19 21:46:44 -06:00
markspanbroek 81eabd4252
[contracts] add --eth-provider and --eth-account options (#86) 2022-04-14 10:20:01 -06:00
Tanguy c06c9b578c
Various dev-ops things (#85)
* Add metrics server
* Add --version
* Fixes for chronicles=trace + ci
2022-04-14 12:49:03 +02:00
markspanbroek b88561e090
Subscribe to proof submissions (#83)
* Update dagger-contracts

* [proving] rename ProofTiming -> Proofs

* Update nim-ethers to 0.1.4

* [proving] Subscribe to proof submissions

* [proving] support proof submission through the Proving abstraction
2022-04-13 10:41:48 -06:00
Tanguy 4d681102e5
Add DHT (#75)
* First implem

* Add persistent net key option

* Working DHT setup

* Bootstrap nodes

* Implement DaggerNode.findPeer

* Remove unrelevant comment

* Added discovery to blockexchange requestBlock

* add FSStore.blockList

* Block advertisement

* Tests compiles

* Green tests

* toDiscoveryId instead of toNodeId

* remove stopAdvertisingBlock

* Removed nim-eth dependency

* Move discovery stuff to discovery.nim

* Add missing file, start of discovery tests

* Better discovery logic

* Add tests

* Address comment

* Better E2E test
2022-04-13 10:32:35 -06:00
zah 4bf28f1619
Merge pull request #80 from status-im/nimble-lock-file
Nimble lock file
2022-04-12 19:24:43 +03:00
Csaba Kiraly ecb62af253
switching back role of G1/G2
newly implemented Constantine feature allows us to use
G1 for authenticators and G2 for the PoS public key.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-04-12 16:02:17 +02:00
Zahary Karadjov b658192540
Nimble lock file 2022-04-12 16:59:00 +03:00
Csaba Kiraly 6c47349125
fixup: bad return value for signature deserialize
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-04-12 15:43:02 +02:00
Tanguy bade020d67
Propper logging options (#81) 2022-04-12 15:21:07 +02:00
Csaba Kiraly e3b4dddaa1
fix debug printing of Constantine BigInt values 2022-04-12 14:45:58 +02:00
Csaba Kiraly 182fb209fc
bumping Constantine verison to include Hash-to-Curve BLS12-381 G1
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-04-12 14:42:08 +02:00
Csaba Kiraly 923b86a67b
fix isOnCurve check
this needs to be changed as well when switching between G1 and G2

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-04-12 14:35:37 +02:00
Csaba Kiraly 4463278c43
remove unused generics to ease compilation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-04-12 14:30:17 +02:00
Csaba Kiraly 62cd099f4f
faster verifyPairings
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-04-12 14:27:34 +02:00
Csaba Kiraly 434b6a1c0d
fix verifyPairings implementation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-04-12 14:17:30 +02:00
markspanbroek 1a3003e043
Update to latest dagger-contracts (#78)
- StorageRequest struct has changed

- StorageRequested event has changed,
  it no longer returns the entire request,
  but only the id and the ask
2022-04-11 12:03:55 -06:00
markspanbroek 168468a3fd
[ci] Speed up CI by eliminating unnecessary runs (#79) 2022-04-11 12:01:32 -06:00
markspanbroek 03fa370624
Proving (#66)
* Add Proving object, which maintains contract id's to watch

* [proving] invoke callback when proof is required

# Conflicts:
#	dagger/por/timing/periods.nim
#	dagger/por/timing/prooftiming.nim

* [proving] check proof requirements for all our contracts

# Conflicts:
#	tests/dagger/helpers/mockprooftiming.nim

* Update vendor/dagger-contracts

* [proving] call onProofRequired() when proof is required soon

* [proving] stop checking contracts that have ended

* [proving] Remove duplicated funcs

* [proving] Implement ProofTiming on top of smart contract

* [proving] Fix race condition in waitUntilNextPeriod()

Sometimes waitUntilNextPeriod would take a while to
determine the current period, leading to unexpected results.

Splits waitUntilNextPeriod() into getCurrentPeriod()
and waitUntilPeriod(), to ensure that we're really waiting
for the period that we think we're waiting for.
2022-04-08 15:58:16 -06:00
Csaba Kiraly 177472ee12
WIP: adding constantine backend
This is WIP, not compiling yet
test with
  cd dagger/storageproofs
  ../../env.sh nim c -r testbls.nim
2022-04-08 20:37:20 +02:00
Dmitriy Ryajov 2e8b39cf7c
fix random failing test (#77) 2022-04-07 17:08:43 -06:00
Csaba Kiraly 01d59992e6
por: separating BLST backend
WIP: func and proc names might be improved later.
2022-04-06 15:09:49 +02:00
Tanguy aa50127c14
Compiler dagger.nim in the CI (#71) 2022-04-06 14:00:25 +02:00
Dmitriy Ryajov ffa9b624f1
Integrate erasure (#73)
* wip: adding request for storage endpoint

* wire in erasure coding

* fix tests for erasure coding

* put type definitions into separate file

* integrate erasure coding

* change run/shutdown to start/stop

* temporary sleep, otherwise the fsstore blocks
2022-04-05 18:34:29 -06:00
Dmitriy Ryajov 22c6705312
rename storageproofs to por (#74) 2022-04-05 14:44:53 -06:00
Dmitriy Ryajov 49c41e27b7
Erasure coding dataset (#72)
* add erasure coding support

* add leopard support

* erasure coding tests
2022-04-05 13:12:59 -06:00
Dmitriy Ryajov 70e4b2e5eb
handle empty blocks (#70) 2022-04-05 08:24:48 -06:00
Dmitriy Ryajov 8ef8cfcd74
add sample proc with exclude array (#68) 2022-04-05 08:24:39 -06:00
Dmitriy Ryajov 3222f436cc
Protected manifest (#69)
* add protected manifes type

* encode protected manifest

* add empty block type handling

* add tests for protected manifest
2022-04-04 18:46:13 -06:00
Dmitriy Ryajov 8146198869
Update deps (#67)
* update nim-presto

* update asynctest to latest

* upgrading deps
2022-04-04 15:49:13 -06:00