Skip to content

Commit

Permalink
release: phase 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jmg-duarte committed Nov 25, 2024
1 parent 75b474c commit db233b6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
18 changes: 17 additions & 1 deletion src/architecture/pallets/market.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ The Market Pallet actions can fail with following errors:
- `InsufficientFreeFunds` - Market participants do not have enough free funds.
- `NoProposalsToBePublished` - `publish_storage_deals` was called with an empty list of `deals`.
- `ProposalsPublishedByIncorrectStorageProvider` - Is returned when calling `publish_storage_deals` and the deals in a list are not published by the same storage provider.
- `AllProposalsInvalid` - `publish_storage_deals` call was supplied with a list of `deals` which are all invalid.
- `DuplicateDeal` - There is more than one deal with this ID in the Sector.
- `DealNotFound` - Tried to activate a deal that is not in the system.
- `DealActivationError` - Tried to activate a deal, but data was malformed.
Expand All @@ -222,6 +221,23 @@ The Market Pallet actions can fail with following errors:
- Deal is not pending.
- `DealsTooLargeToFitIntoSector` - Sum of all deals piece sizes for a sector exceeds sector size. The sector size is based on the registered proof type. We currently only support registered `StackedDRG2KiBV1P1` proofs, which have 2KiB sector sizes.
- `TooManyDealsPerBlock` - Tried to activate too many deals at a given `start_block`.
- `StorageProviderNotRegistered` - An account tries to call `publish_storage_deals` but is not registered as a storage provider.
- `CommD` - An error occurred when trying to calculate CommD.
- `TooManyPendingDeals` - A storage provider tried to propose a deal, but there are too many pending deals. The pending deals should be activated or wait for expiry.
- `InvalidProvider` - A deal was tried to be activated by a provider which does not own it.
- `StartBlockElapsed` - A storage provider tries to activate a deal after the start block.
- `SectorExpiresBeforeDeal` - Sector containing the deal will expire before the deal is supposed to end.
- `InvalidDealState` - A deal was attempted to be activated twice.
- `DealNotPending` - A storage provider tried to activate a deal which is not in the pending proposals.
- `WrongClientSignatureOnProposal` - The client signature did not match the client's public key and data.
- `DealEndBeforeStart` - A deal was attempted to be published but the end block is before the start block and the deal is rejected.
- `DealStartExpired` - A deal was attempted to be published but the start block is in the past and the deal is rejected.
- `DealNotPublished` - A deal was attempted to be published but is not in the correct state.
- `DealDurationOutOfBounds` - A deal was attempted to be published but the duration is not between [MinDealDuration](#constants) and [MaxDealDuration](#constants).
- `InvalidPieceCid` - The deal trying to be published has an invalid piece Cid.
- `DealIsNotActive` - When a sector is being terminated but the deal state is not active. This is the result of a programmer bug. Please [report an issue](https://github.com/eigerco/polka-storage-book/issues/new) to the developers.
- `InvalidCaller` - A deal was found that does not belong to the storage provider. This is the result of a programmer bug. Please [report an issue](https://github.com/eigerco/polka-storage-book/issues/new) to the developers.
- `DealNotFound` - A deal was attempted to be fetched but could not be found. This is the result of a programmer bug. Please [report an issue](https://github.com/eigerco/polka-storage-book/issues/new) to the developers.
- `UnexpectedValidationError` - `publish_storage_deals`'s core logic was invoked with a broken invariant that should be called by `validate_deals`. Please [report an issue](https://github.com/eigerco/polka-storage-book/issues/new) to the developers.
- `DealPreconditionFailed` - Due to a programmer bug. Please [report an issue](https://github.com/eigerco/polka-storage-book/issues/new) to the developers.

Expand Down
23 changes: 20 additions & 3 deletions src/getting-started/demo-file-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Alice is a [Storage User](../glossary.md#storage-user) and wants to store an ima
Alice knows that she needs to prepare an image for storage and get its [CID](https://github.com/multiformats/cid).
To do so, she first converts it into a [CARv2 archive](https://ipld.io/specs/transport/car/carv2/) and gets the piece cid.

<div class="warning">

**🚧 Currently, the maximum supported piece size is 2048 bytes!**

</div>

```bash
$ mater-cli convert -q --overwrite polkadot.svg polkadot.car
bafkreihoxd7eg2domoh2fxqae35t7ihbonyzcdzh5baevxzrzkaakevuvy
Expand Down Expand Up @@ -112,9 +118,6 @@ To sign her deal proposal she runs:
```bash
$ polka-storage-provider-client sign-deal --sr25519-key "//Alice" @polka-logo-deal.json
```
```json
{
"deal_proposal": {
"piece_cid": "baga6ea4seaqabpfwrqjcwrb4pxmo2d3dyrgj24kt4vqqqcbjoph4flpj2e5lyoq",
Expand Down Expand Up @@ -147,3 +150,17 @@ Successfully published deal of id: 0
```
On Alice's side, that's it!
> Note that you **must** sign and submit the deals before the `start_block`!
>
> Currently, the storage provider **does not reject deal proposals** on the basis of how early or late they are,
> however, this may change! ⚠️ — for example, if a storage provider knows that they won't have enough time to process
> your file for proof submission, they may refuse your proposal on the basis that if they accept it, they may fail the deadline.
## Additional Notes
* As other parts of this project, file retrieval is actively being worked on! 🚧
* Files stored in storage providers are public, as such, we suggest you encrypt your files.
While file encryption is a broad enough topic, if you not sure about which tools to use,
we suggest you keep it simple by compressing your file in a format such as [7zip](https://www.7-zip.org/) and using its encryption features.
If 7zip doesn't cut it, you may want to take a look into [age](https://github.com/FiloSottile/age) or [VeraCrypt](https://www.veracrypt.fr/code/VeraCrypt/).

0 comments on commit db233b6

Please sign in to comment.