425 Commits

Author SHA1 Message Date
Marcin Czenko
534cb7193e
updates and integrates torrentdownloader into api and node 2025-06-03 03:00:59 +02:00
Marcin Czenko
2aa91e5f93
adds more tests and ability to retrieve the downloaded blocks 2025-06-03 03:00:59 +02:00
Marcin Czenko
c859250c4a
adds some good weather tests for torrentdownloader 2025-06-03 03:00:59 +02:00
Marcin Czenko
ee2f403e52
do not randomize piece fetching sequence for now 2025-06-03 03:00:58 +02:00
Marcin Czenko
50ca6dae5f
adds torrent downloader abstraction 2025-06-03 03:00:58 +02:00
Marcin Czenko
86166196de
adds push raises to a couple of new files 2025-06-03 03:00:58 +02:00
Marcin Czenko
2e77c4a62c
removes unused import 2025-06-03 03:00:58 +02:00
Marcin Czenko
774f6d2841
fixes checking block results 2025-06-03 03:00:57 +02:00
Marcin Czenko
42b74cc11f
uses MultiHash as a type for piece hashes (instead alias) 2025-06-03 03:00:57 +02:00
Marcin Czenko
927e67e0c3
updates torrent streaming to take advantage of the new interface of the piece validator 2025-06-03 03:00:56 +02:00
Marcin Czenko
1d47cf4870
Updates client streaming to use new piece validator interface 2025-06-03 03:00:56 +02:00
Marcin Czenko
9903473809
updates pieceValidator with better internal state management 2025-06-03 03:00:56 +02:00
Marcin Czenko
45ab5eee92
adds torrent piece validator abstraction to keep streaming in sync with piece validation 2025-06-03 03:00:56 +02:00
Marcin Czenko
0748a348e7
makes torrent decode func from openArray data public 2025-06-03 03:00:56 +02:00
Marcin Czenko
96d28e8563
adds "==" operator to torrent manifest 2025-06-03 03:00:56 +02:00
Marcin Czenko
5846fbce70
improves exception handling 2025-06-03 03:00:55 +02:00
Marcin Czenko
42f4aa21b9
sets the default piece length to be 256KiB 2025-06-03 03:00:55 +02:00
Marcin Czenko
93befc9dac
fine tunes logging while aggregating pieces 2025-06-03 03:00:55 +02:00
Marcin Czenko
040341b796
removes duplication while streaming torrent content 2025-06-03 03:00:55 +02:00
Marcin Czenko
95daf3782e
removes redundant echos 2025-06-03 03:00:54 +02:00
Marcin Czenko
249b799225
adds BitTorrent REST API to fetch torrent manifest only 2025-06-03 03:00:54 +02:00
Marcin Czenko
ff04de52da
moves initializer around to prevent circ deps 2025-06-03 03:00:54 +02:00
Marcin Czenko
fe1cc15fbd
adds JSON serialization to BitTorrent manifest 2025-06-03 03:00:54 +02:00
Marcin Czenko
f0a9306320
adds BitTorrent specific constants 2025-06-03 03:00:54 +02:00
Marcin Czenko
096dff0714
makes cleaner streaming API and updates return type of retrieveInfoHash proc 2025-06-03 03:00:53 +02:00
Marcin Czenko
ddc8e58861
fixes some basic decoding and padding mistakes 2025-06-03 03:00:53 +02:00
Marcin Czenko
3a7f18dea2
fix logging 2025-06-03 03:00:53 +02:00
Marcin Czenko
fece905431
adds torrent uploading API 2025-06-03 03:00:53 +02:00
Marcin Czenko
2ab59f616d
makes torrent API ready for torrents v2, closes torrent streaming loop 2025-06-03 03:00:53 +02:00
Marcin Czenko
6c5816581a
simplifies torrent streaming API 2025-06-03 03:00:52 +02:00
Marcin Czenko
d5928988d0
adds API for streaming torrents 2025-06-03 03:00:52 +02:00
Marcin Czenko
8a8bab3672
adds info hash validation 2025-06-03 03:00:52 +02:00
Marcin Czenko
bcf622ecd8
formatting 2025-06-03 03:00:52 +02:00
Marcin Czenko
0d9bad674a
adds torrent streaming and piece validation 2025-06-03 03:00:52 +02:00
Marcin Czenko
cd8d2b130a
moves BitTorrent stuff around a bit to de-clutter node.nim 2025-06-03 03:00:52 +02:00
Marcin Czenko
4981d5b943
temporarily reuse existing torrent-info multicodec 2025-06-03 03:00:51 +02:00
Marcin Czenko
e423662169
makes sure that torrent info_hash cids are not validated in block constructor 2025-06-03 03:00:51 +02:00
Marcin Czenko
494765ba74
general idea of BitTorrent integration 2025-06-03 03:00:51 +02:00
Marcin Czenko
d85b146602
advertising torrent info hash on DHT 2025-06-03 03:00:51 +02:00
Marcin Czenko
e4a04f37da
adds Torrent BlockType 2025-06-03 03:00:51 +02:00
Marcin Czenko
6938ba203d
adds TorrentInfoHashNamespace 2025-06-03 03:00:51 +02:00
Marcin Czenko
76c938433e
adds multicodec for SHA1 and for torrent info hash 2025-06-03 03:00:50 +02:00
Arnaud
ca869f6dce
fix(availabilities): use totalRemainingCollateral instead of totalCollateral for comparaison (#1229)
* Use totalRemainingCollateral instead of totalCollateral to compare the availability changes

* Update test to use totalRemainingCollateral instead of totalCollateral when testing OnAvailabilitySaved

* Reduce poll interval

* Fix flaky test

* Fix format
2025-06-02 16:47:12 +00:00
Slava
e43872d0b8
chore: update testnet marketplace address (#1245)
https://github.com/codex-storage/nim-codex/issues/1241
2025-05-30 09:12:55 +00:00
Giuliano Mega
d59c5b023c
chore: bump Nim to 2.2.4 (#1242)
* chore: bump Nim to 2.2.4

* fix: resolve symbol ambiguity and drop auto type

* fix: use reference to task instead of pointer or the compiler will deallocate `task` before the encoding/decoding is done

* fix: convention that maxCollateralPerByte equals totalRemainingCollateral when freeSize is 0 to avoid DivByZeroDefect

* fix: bump compiler version in CI pipeline as well
2025-05-29 16:37:38 -07:00
Arnaud
28a83db69e
chore: returns the collateral when a slot is reserved but not filled (#1216)
* Change token allowance method because increaseAllowance does not exist anymore

* Returns collateral when a reservation is deleted and not only a slot is filled

* Remove the returnedCollateral when the slot is not filled by the host

* Add returnedCollateral when the sale is ignored

* Add returnsCollateral variable for ignored state

* Rebase the contracts submodule on the master

* Add integration test

* Fix duration

* Remove unnecessary teardown function

* Remove misleading comment

* Get returned collateral from the request

* Enable logs to debug on CI

* Fix test

* Increase test timeout

* Fix typo

* Fix rebase
2025-05-29 14:47:37 +00:00
Arnaud
827d9ccccf
Update contracts (#1238) 2025-05-29 08:27:41 +00:00
Arnaud
c689542579
fix: sales cleanup cancellation (#1234)
* fix(sales): handle cancellation of slot cleanup

Ensures that processing slots from the slot queue
continues even when cleanup of a slot is cancelled.

Co-Authored-By: Eric <5089238+emizzle@users.noreply.github.com>

* chore(reservations): add more `raises` annotations

* Fix cleanup cancellation

* Add remove-agent to trackedfutures instead of the cleanup function

* Increase the timeout to match the request expiry

* Enable logs to debug on CI

* Remove useless except and do not return when add item back to slot queue fails

* Reduce poll interval to detect sale cancelled state

* Avoid cancelling cleanup routine

* Do not cancel creating reservation in order to avoid inconsistent state

* Remove useless try except

---------

Co-authored-by: Mark Spanbroek <mark@spanbroek.net>
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
2025-05-29 06:57:05 +00:00
munna0908
71422f0d3d
fix: Support for mapping multiple listener address (#1236)
* multi address mapping support

* fix thread issues

* fix local thread var issue

* chore: rename stopNatThread to stopNatThreads

---------

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2025-05-27 09:05:43 +00:00
Ben Bierens
bfbd7264df
Adds missing async-raises for prover.verify (#1237) 2025-05-26 15:48:59 +00:00