Commit Graph

154 Commits

Author SHA1 Message Date
Csaba Kiraly 45848527ca
por: add description for backend selection
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-05-19 11:54:31 +02:00
Csaba Kiraly 9cc4f449f7
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-19 11:49:18 +02:00
Csaba Kiraly ce566d2548
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-05-19 11:49:18 +02:00
Csaba Kiraly 7d8f2f9944
fixup: bad return value for signature deserialize
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-05-19 11:49:17 +02:00
Csaba Kiraly 35688c9b3a
fix debug printing of Constantine BigInt values 2022-05-19 11:49:17 +02:00
Csaba Kiraly 9767390018
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-05-19 11:49:17 +02:00
Csaba Kiraly d2cd79a754
remove unused generics to ease compilation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-05-19 11:49:17 +02:00
Csaba Kiraly aa4596310a
faster verifyPairings
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-05-19 11:49:17 +02:00
Csaba Kiraly ddb613249a
fix verifyPairings implementation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-05-19 11:49:16 +02:00
Csaba Kiraly 9cc92f117f
WIP: adding constantine backend
This is WIP, not compiling yet
test with
  cd dagger/storageproofs
  ../../env.sh nim c -r testbls.nim
2022-05-19 11:49:06 +02:00
Csaba Kiraly 31d7e712e5
por: separating BLST backend
WIP: func and proc names might be improved later.
2022-05-19 11:46:48 +02:00
Csaba Kiraly bad8186939
storegeproofs: update README
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2022-05-19 11:44:57 +02:00
Csaba Kiraly 17d802a2f0
use more inplace procs 2022-05-19 11:44:56 +02:00
Mark Spanbroek a87986cdd6 [purchasing] add expiry to storage request via REST API 2022-05-19 10:38:19 +02:00
Mark Spanbroek 8086dda3f2 [purchasing] set selected offer on purchase 2022-05-19 10:38:19 +02:00
Mark Spanbroek d8ef633fb0 [proving] Do not log error when cancelling 2022-05-19 10:38:19 +02:00
Mark Spanbroek cdcab43590 [proving] Use clock instead of getPeriod() and waitUntilPeriod() 2022-05-19 10:38:19 +02:00
Mark Spanbroek 09a7aa3eed [clock] Replace Market.waitUntil() with Clock.waitUntil() 2022-05-19 10:38:19 +02:00
Mark Spanbroek 83522e459c [clock] Avoid crash when getBlock fails 2022-05-19 10:38:19 +02:00
Mark Spanbroek 3a8ce485e4 [sales] Use Clock instead of getTime() 2022-05-19 10:38:19 +02:00
Mark Spanbroek 1e44ed5fd3 [purchasing] Use Clock instead of getTime() 2022-05-19 10:38:19 +02:00
Mark Spanbroek 4210cca6e7 [proving] Use Clock instead of getTime() 2022-05-19 10:38:19 +02:00
Mark Spanbroek 8d19476a4c [sales] Ensure that Sales is completely stopped 2022-05-19 10:38:19 +02:00
Mark Spanbroek 3f627790f8 [proving] Ensure that proving is completely stopped 2022-05-19 10:38:19 +02:00
Mark Spanbroek ea72d99798 [clock] Add Clock interface that abstracts away ethereum details 2022-05-19 10:38:19 +02:00
Mark Spanbroek fa84861d86 [contracts] Add Clock that synchronizes time with EVM 2022-05-19 10:38:19 +02:00
Mark Spanbroek 1848c0334d [purchasing] add purchase status to json output 2022-05-19 10:38:19 +02:00
Mark Spanbroek b31ef8356b [purchasing] retrieve purchase details through REST API 2022-05-19 10:38:19 +02:00
Mark Spanbroek fb56f60d77 [purchasing] keep track of all purchases 2022-05-19 10:38:19 +02:00
Mark Spanbroek 466f109193 [purchasing] start purchase through REST API 2022-05-19 10:38:19 +02:00
Mark Spanbroek 7d03e83bfc [rest api] submit storage request parameters as json 2022-05-19 10:38:19 +02:00
Mark Spanbroek 4d00814f9e [erasure] Handle edge case of 0 parity blocks 2022-05-19 10:38:19 +02:00
Mark Spanbroek 11581fd12c [sales] REST endpoint that lists available storage 2022-05-19 09:36:47 +02:00
Mark Spanbroek d564cc2375 [sales] Use UInt256 for size and duration
Use the same data types for availability and requests
for simplicity.
2022-05-19 09:36:47 +02:00
Mark Spanbroek ef80871984 [sales] Perform POST with JSON body instead of URL params 2022-05-19 09:36:47 +02:00
Mark Spanbroek 45c55ab2a8 [sales] Test sales rest api 2022-05-19 09:36:47 +02:00
Mark Spanbroek e2959d4fe5 [sales] Add REST API for sales availability 2022-05-19 09:36:47 +02:00
Dmitriy Ryajov d3dbbc75fa
Extract Discovery engine (#99)
* don't force logging syncs

* Add failing test

* wip discovery engine

* re-add chronicles sinks

* wip

* move network related stuff to own folder

* move peer related stuff to own folder

* extract discovery into it's own engine

* update imports

* move pending blocks into engine module

* add top level exports

* update imports

* update import paths

* update imports

* support for inflight request filtering and tests

* use `remove` instead of `del`

* fix sorting in `selectCheapest`

* re-org test file structure

* fix to use discovery engine

* file re-org

* fix compilation

* fixup discovery to use async handlers

* more re-org

* rework with support for discovery engine

* add logging

* use defaults

* wip: reworking with discoveryengine

* wip: more test fixes

* more logging

* use ordered table

* use `bt` for blocktype Block

* fix tests

* make tests work with discovery engine

* expose all node components

* fix to work with discovery engine

* wip

* propagate cancellation in listBlocks

* start/stop disc engine in blockexc engine

* remove disc engine start/stop

* wire up discovery engine

* misc comments and imports

* pass discovery to dagger node

* set sleep timers

* unused imports

* misc

* don't spawn a task, await it

* don't await handlers

* trace logging

* reduce default sleep time

Co-authored-by: Tanguy <tanguy@status.im>
2022-05-18 20:29:15 -06: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
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 fae05fce86 [contracts] Do not crash when contract interaction fails
Log error instead.
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