-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: createReservation lock (#825) * fix: createReservation lock * fix: additional locking places * fix: acquire lock * chore: feedback Co-authored-by: markspanbroek <[email protected]> Signed-off-by: Adam Uhlíř <[email protected]> * feat: withLock template and fixed tests * fix: use proc for MockReservations constructor * chore: feedback Co-authored-by: Eric <[email protected]> Signed-off-by: Adam Uhlíř <[email protected]> * chore: feedback implementation --------- Signed-off-by: Adam Uhlíř <[email protected]> Co-authored-by: markspanbroek <[email protected]> Co-authored-by: Eric <[email protected]> * Block deletion with ref count & repostore refactor (#631) * Fix StoreStream so it doesn't return parity bytes (#838) * fix storestream so it doesn\'t return parity bits for protected/verifiable manifests * use Cid.example instead of creating a mock manually * Fix verifiable manifest initialization (#839) * fix verifiable manifest initialization * fix linearstrategy, use verifiableStrategy to select blocks for slots * check for both strategies in attribute inheritance test * ci: add verify_circuit=true to the releases (#840) * provisional fix so EC errors do not crash the node on download (#841) * prevent node crashing with `not val.isNil` (#843) * bump nim-leopard to handle no parity data (#845) * Fix verifiable manifest constructor (#844) * Fix verifiable manifest constructor * Add integration test for verifiable manifest download Add integration test for testing download of verifiable dataset after creating request for storage * add missing import * add testecbug to integration suite * Remove hardhat instance from integration test * change description, drop echo --------- Co-authored-by: Eric <[email protected]> Co-authored-by: gmega <[email protected]> --------- Signed-off-by: Adam Uhlíř <[email protected]> Signed-off-by: Slava <[email protected]> Co-authored-by: Adam Uhlíř <[email protected]> Co-authored-by: markspanbroek <[email protected]> Co-authored-by: Eric <[email protected]> Co-authored-by: Tomasz Bekas <[email protected]> Co-authored-by: Giuliano Mega <[email protected]>
- Loading branch information
1 parent
15ff87a
commit 7602adc
Showing
7 changed files
with
113 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from pkg/libp2p import Cid, init | ||
import ../examples | ||
import ./marketplacesuite | ||
import ./nodeconfigs | ||
import ./hardhatconfig | ||
|
||
marketplacesuite "Bug #821 - node crashes during erasure coding": | ||
|
||
test "should be able to create storage request and download dataset", | ||
NodeConfigs( | ||
clients: | ||
CodexConfigs.init(nodes=1) | ||
# .debug() # uncomment to enable console log output.debug() | ||
.withLogFile() # uncomment to output log file to tests/integration/logs/<start_datetime> <suite_name>/<test_name>/<node_role>_<node_idx>.log | ||
.withLogTopics("node", "erasure", "marketplace", ) | ||
.some, | ||
|
||
providers: | ||
CodexConfigs.init(nodes=0) | ||
# .debug() # uncomment to enable console log output | ||
# .withLogFile() # uncomment to output log file to tests/integration/logs/<start_datetime> <suite_name>/<test_name>/<node_role>_<node_idx>.log | ||
# .withLogTopics("node", "marketplace", "sales", "reservations", "node", "proving", "clock") | ||
.some, | ||
): | ||
let reward = 400.u256 | ||
let duration = 10.periods | ||
let collateral = 200.u256 | ||
let expiry = 5.periods | ||
let data = await RandomChunker.example(blocks=8) | ||
let client = clients()[0] | ||
let clientApi = client.client | ||
|
||
let cid = clientApi.upload(data).get | ||
|
||
var requestId = none RequestId | ||
proc onStorageRequested(event: StorageRequested) {.raises:[].} = | ||
requestId = event.requestId.some | ||
|
||
let subscription = await marketplace.subscribe(StorageRequested, onStorageRequested) | ||
|
||
# client requests storage but requires multiple slots to host the content | ||
let id = await clientApi.requestStorage( | ||
cid, | ||
duration=duration, | ||
reward=reward, | ||
expiry=expiry, | ||
collateral=collateral, | ||
nodes=3, | ||
tolerance=1 | ||
) | ||
|
||
check eventually(requestId.isSome, timeout=expiry.int * 1000) | ||
|
||
let request = await marketplace.getRequest(requestId.get) | ||
let cidFromRequest = Cid.init(request.content.cid).get() | ||
let downloaded = await clientApi.downloadBytes(cidFromRequest, local = true) | ||
check downloaded.isOk | ||
check downloaded.get.toHex == data.toHex | ||
|
||
await subscription.unsubscribe() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule nim-leopard
updated
from 1a6f2a to 895ff2