- Update async procedures to use explicit raises annotation
- Modify TrackedFutures to handle futures with no raised exceptions
- Replace `asyncSpawn` with explicit future tracking
- Update test suites to use `unittest2`
- Standardize error handling across network and async components
- Remove deprecated error handling patterns
This commit introduces a more robust approach to async error handling and future management, improving type safety and reducing potential runtime errors.
* adding basic retry functionality
* avoid duplicate requests and batch them
* fix cancelling blocks
* properly resolve blocks
* minor cleanup - use `self`
* avoid useless asyncSpawn
* track retries
* limit max inflight and set libp2p maxIncomingStreams
* cleanup
* add basic yield in readLoop
* use tuple instead of object
* cleanup imports and logs
* increase defaults
* wip
* fix prefetch batching
* cleanup
* decrease timeouts to speedup tests
* remove outdated test
* add retry tests
* should track retries
* remove useless test
* use correct block address (index was off by 1)
* remove duplicate noop proc
* add BlockHandle type
* Use BlockHandle type
* add fetchLocal to control batching from local store
* add format target
* revert deps
* adjust quotaMaxBytes
* cleanup imports and logs
* revert deps
* cleanup blocks on cancelled
* terminate erasure and prefetch jobs on stream end
* split storing and retrieving data into separate tests
* track `b.discoveryLoop` future
* misc
* remove useless check
* fix(statemachine): do not raise from state.run
* fix rebase
* fix exception handling in SaleProvingSimulated.prove
- re-raise CancelledError
- don't return State on CatchableError
- expect the Proofs_InvalidProof custom error instead of checking a string
* asyncSpawn salesagent.onCancelled
This was swallowing a KeyError in one of the tests (fixed in the previous commit)
* remove error handling states in asyncstatemachine
* revert unneeded changes
* formatting
* PR feedback, logging updates
* chore(deps): bump ethers to propagate cancellations
Ethers was swallowing canellations and turning them into EthersErrors, which was causing the sales statemachine to error when it should have been simply cancelling the current state's run. Hopefully fixes the intermittently failing marketplace integration test.
* Add missing errors in async raises pragma
* bump to version of ethers that supports cancellations
---------
Co-authored-by: Arnaud <arnaud@status.im>
* feat(codex-node): add dataset deletion API to Codex node
* feat(api): add deletion of local datasets to API
* fix: logging, remove garbage, drop some CORS headers from DELETE request
* fix: change empty response return code to 204 instead of 200
* fix: add time-based idling to avoid locking up the node during deletes, fix API status code
* fix: uncomment commented tests committed by accident
* fix: return correct code when missing CID is a Manifest CID; add back CORS headers
* fix: remove lingering echo
* fix(build): compilation on macos when including nim-nat-traversal
- removes the `VERSION` rename to `VERSION_temp` in the Makefile
- instead, relies on `-iqoute` to include the `nim-nat-traversal/vendor/libnatpmp-upstream` directory in the search paths. `-iquote` will match the `vendor/libnatpmp-upstream/VERSION` file for `#include "version"` and not `#include <version>`, the latter being what is included by the macos sdk and was causing issues with `-I`. The [gcc 14.2 docs](https://gcc.gnu.org/onlinedocs/gcc-14.2.0/cpp/Invocation.html#index-I) describe how `-iquote` alleviates this issue:
> Directories specified with -iquote apply only to the quote form of the directive, #include "file". Directories specified with -I, -isystem, or -idirafter apply to lookup for both the #include "file" and #include <file> directives.
For more info, please see https://github.com/status-im/nim-nat-traversal/pull/34.
* bump nim-nat-traversal
Now that https://github.com/status-im/nim-nat-traversal/pull/34 has been merged, change back to master commit
* add ccache and sccache to speed up CI
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* include testname and nim version in cache separation
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* Make sure ccache has precedence over custom clang/llvm
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* enable ccache for windows
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* ccache: evict old files
Make sure old unused cache files are not lingering around for long
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* fixes datasetSize and slotSize helpers (and also RandomChunker.example)
* adds overload for <<upload>> for seq[byte]
* changes RandomChunker.example to return seq[byte]
* fixes restapi tests after correcting RandomChunker.example
* review: use string.fromBytes from nim-stew to convert seq[byte] to string
* openAPI: StorageRequestCreation: reward => pricePerByte, collateral => collateralPerByte
* purchasing: reward => pricePerByte, collateral => collateralPerByte
* Updates availabilities and reservations to use totalCollateral, minPricePerByte, and maxCollateralPerByte
* Uses correct div operator when operating on UInt256
* proposal updating totalCollateral in availability
* makes sure that reading currentCollateral happens before freeing slot
* Updates naming
* fixes tests: unit and contracts
* uses feat/price-per-byte branch for codex-contracts-eth
* temporarily disables integration tests on CI
* introduces high level <<totalCollateral>> property for a cleaner external interface
* updates integration tests
* Applies review comments
* Updates description of totalCollateral in SalesAvailability
* updates codex-contracts-eth (price-per-byte)
Using nimbus build system since the codex now uses version of Nim >2.
Tested with nim versions(>2) in nixpkgs but none of them work thus the
removal of USE_SYSTEM_NIM and its logic.
Signed-off-by: markoburcul <marko@status.im>
* Move to version 2.0.6
* Update nim-confutils submodule to latest version
* Update dependencies
* Update Nim version to 2.0.12
* Add gcsafe pragma
* Add missing import
* Update specific conf for Nim 2.x
* Fix method signatures
* Revert erasure coding attempt to fix bug
* More gcsafe pragma
* Duplicate code from libp2p because it is not exported anymore
* Fix camelcase function names
* Use alreadySeen because need is not a bool anymore
* newLPStreamReadError does not exist anymore so use another error
* Replace ValidIpAddress by IpAddress
* Add gcsafe pragma
* Restore maintenance parameter deleted by mistake when removing esasure coding fix attempt code
* Update method signatures
* Copy LPStreamReadError code from libp2p which was removed
* Fix camel case
* Fix enums in tests
* Fix camel case
* Extract node components to a variable to make Nim 2 happy
* Update the tests using ValidIpAddress to IpAddress
* Fix cast for value which is already an option
* Set nim version to 2.0.x for CI
* Set nim version to 2.0.x for CI
* Move to miniupnp version 2.2.4 to avoid symlink error
* Set core.symlinks to false for Windows for miniupnp >= 2.2.5 support
* Update to Nim 2.0.14
* Update CI nim versions to 2.0.14
* Try with GCC 14
* Replace apt-fast by apt-get
* Update ubuntu runner to latest
* Use Ubuntu 20.04 for coverage
* Disable CI cache for coverage
* Add coverage property description
* Remove commented test
* Check the node value of seen instead of using alreadySeen
* Fix the merge. The taskpool work was reverted.
* Update nim-ethers submodule
* Remove deprecated ValidIpAddress. Fix missing case and imports.
* Fix a weird issue where nim-confutils cannot find NatAny
* Fix tests and remove useless static keyword
* sends wantBlock to peers with block. wantHave to everyone else
* Cleanup cheapestPeer. Fixes test for peers lists
* Fixes issue where peerWants are only stored for type wantBlock.
* Review comments by Dmitriy
* consistent logging of addresses
* prevents duplicate scheduling. Fixes cancellation
* fast
* Marks cancel-presence situation with todo comment.
* fixtest: testsales enable logging
* Review by Dmitriy: Remember peerWants only if we don't have them.
* rework `wantListHandler` handling
---------
Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>