-
Notifications
You must be signed in to change notification settings - Fork 1
refactor(marketplace)!: new interface part 3 #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
These are all automatically picked up by testNode
585e97f to
a3036db
Compare
a3036db to
c71adee
Compare
benbierens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like where this is going.
| method unsubscribe*(subscription: OnChainMarketSubscription) {.async: (raises: []).} = | ||
| try: | ||
| await noCancel subscription.eventSubscription.unsubscribe() | ||
| except ProviderError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my info: when does ProviderError happen?
| await clock.start() | ||
| success clock | ||
| except CancelledError as error: | ||
| raise error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you omit these lines "except CancelledError" ... "raise error", wouldn't it result in the same thing?
| import ../utils/json | ||
| import ../manifest | ||
| import ../units | ||
| import ../clock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this import wasn't required but now it is, I don't see why. :o
| validator = some ValidatorInteractions.new(clock, validation) | ||
|
|
||
| s.archivistNode.contracts = (client, host, validator) | ||
| s.archivistNode.marketplace = marketplace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file make me so happy...
| check expectedData.len == data.len | ||
| check expectedData == data | ||
|
|
||
| test "slot repair calls onBatch callback and sets expiry": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this test isn't exactly a pearl of coding, but...
it was covering a testnet-discovered issue in which blocks resulting from repair had default-expiry instead of contract-duration-expiry.
I can disable node.nim:714 if err =? (await updateExpiry(@[blk])).errorOption: and I don't think any tests will catch this. Now I am entirely in favor of destroying this code. And the whole expiry system is being redesigned. But is there a way to cover this behavior? Or is it not worth the effort at this time?
| let request = await testbed.request.nodes(3).submit(node) | ||
| let size = request.dataset.data.len | ||
| # start request | ||
| # 9 slots makes the odds that all slots are filled by one node negligable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This smells like it could go wrong once in a great while.
What I did is: calculate the slot size and set each provider availability to be slot size + 10%
Then have nodes = 3 and 4 providers.
You can use the slotFilled events to find any one provider and stop it and you're also guaranteed that there's capacity for repair.
MarketplaceNodeas the main interface for sales, purchasing and validation.