Conversation
53ba2fa to
cbe0341
Compare
cbe0341 to
1238fe5
Compare
1238fe5 to
241b13a
Compare
241b13a to
25efce9
Compare
25efce9 to
42cd176
Compare
42cd176 to
58a1c46
Compare
58a1c46 to
1f4b918
Compare
There was a problem hiding this comment.
There are two competing fibre blob submission paths, and one of them is incomplete
modfibre.Upload
The newly introduced API, however, is incomplete as it doesn't send the PFF transactions. The comment mentions that users should use modblob.SubmitFibreBlob to send TXs; however, doing so requires reuploading the entire blob over the API, and modblob.SubmitFibreBlob reuploads it again.
Essentially, there is no way for fibre users of Upload to pay for their uploads
modblob.SubmitFibreBlob
The purpose of this method is unclear. It duplicates the entire fibre blob submission on the old blob service, however, the intention was clearly to introduce a new API as seen in the new fibre module, so why duplicate? If the intention was to allow sending PFFs through this module, then it is unclear why blob module would be responsible for that and not fibre.
Too many layers of indirections
With this PR we have:
- modfibre.Module
fibre.Clientfibre.client- txclient fibre methods
appfibre.Client
This is extremely messy and a pure pain to review. We can easily squash a bunch of them with no repercussions into:
- modfibre.Module
fibre.Serviceappfibre.Client.
Besides, for whatever reason, out of all those layers, the txclient turned out to be responsible for actually uploading. TxClient, Carl! It is supposed to send transactions and not call appfibre.Client.Upload.
Subscriptions
There is no way to subscribe for blobs from fibre in the order they'be landed through consensus.
|
This PR was done in accordance to the ADR, made by @cmwaters.
Auto-fetching full fibre data from FSPs needs design work first. Feel free to open an ADR update with a proposal |
|
@vgonkivs, I acknowledge that the PR implements the ADR. However, it does not change the fact that users can't pay for the uploads they make and we should fix this.
The subscription does not imply listening for data from FSPs, but listening to new fibre-blobs in the square and fetching respective fibre blobs by commitment. |
|
Feel free to open an ADR update with a proposal |
|
Nothing is stopping us from modifying the ADR in this PR. That's a normal feedback process where during implementation issues are discovered and spec/adr is updated accordingly. |
|
There is no final decision yet on the upload, so no changes were made to this part. |
74da0df to
ccf7be5
Compare
2207eb5 to
a02e7c8
Compare
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
a02e7c8 to
2feab33
Compare
2feab33 to
ab049b4
Compare
fe7fcb6 to
988d326
Compare
There was a problem hiding this comment.
last pass, mostly nits and questions
P.S. I haven't reviewed the AccountClient API from a user perspective to determine whether the added endpoints make sense and cover all use cases. The case with Upload completely disincentivized me from reviewing user flow completeness. While the point was correct, it created more tension than good because of the communication style. I trust you guys can review and communicate such things better.
| test-unit: | ||
| @echo "--> Running unit tests" | ||
| @go test $(VERBOSE) -covermode=atomic -coverprofile=coverage.txt `go list ./... | grep -v nodebuilder/tests` $(LOG_AND_FILTER) | ||
| @go test $(VERBOSE) -tags=fibre -covermode=atomic -coverprofile=coverage.txt `go list ./... | grep -v nodebuilder/tests` $(LOG_AND_FILTER) |
There was a problem hiding this comment.
do we need this tag so that app picks the fibre app?
There was a problem hiding this comment.
w/o the tag all tests that are using app node will be constantly failing. It's a temp solution.
| type SubmitResult struct { | ||
| // BlobID is the Fibre blob identifier for the submitted blob. |
There was a problem hiding this comment.
just an idea to make SubmitResult embed the UploadResult. This will imply that Submit operation does Upload + some stuff which it is and deduplication.
| // It encodes the blob, constructs a payment promise, uploads encoded rows to FSPs, | ||
| // and aggregates validator availability signatures. It does NOT submit MsgPayForFibre on-chain. | ||
| // Use blob.SubmitFibreBlob for the full submit flow. | ||
| Upload(_ context.Context, _ libshare.Namespace, _ []byte, _ *txclient.TxConfig) (*UploadResult, error) |
There was a problem hiding this comment.
nit: not sure why they are all underscore, would be helpful to name bytes as data for example
| // It encodes the blob, constructs a payment promise, uploads encoded rows to FSPs, | ||
| // and aggregates validator availability signatures. It does NOT submit MsgPayForFibre on-chain. | ||
| // Use blob.SubmitFibreBlob for the full submit flow. | ||
| Upload(_ context.Context, _ libshare.Namespace, _ []byte, _ *txclient.TxConfig) (*UploadResult, error) |
There was a problem hiding this comment.
If it doesn't send tx, why does it expect txclient? To future proof?
| // It encodes the blob, constructs a payment promise, uploads encoded rows to FSPs, | ||
| // and aggregates validator availability signatures. It does NOT submit MsgPayForFibre on-chain. | ||
| // Use blob.SubmitFibreBlob for the full submit flow. | ||
| Upload(_ context.Context, _ libshare.Namespace, _ []byte, _ *txclient.TxConfig) (*UploadResult, error) |
There was a problem hiding this comment.
I would mention that we send v0 fibre blob as we currently do no support specifying which version
| Upload(_ context.Context, _ libshare.Namespace, _ []byte, _ *txclient.TxConfig) (*UploadResult, error) | ||
| // Get retrieves a Fibre blob from FSPs by blobID. | ||
| // It reconstructs the original blob data from the encoded rows stored off-chain. | ||
| Get(ctx context.Context, blobID []byte) (*GetBlobResult, error) |
There was a problem hiding this comment.
Why not a specific type for blobID?
There was a problem hiding this comment.
to avoid external types where it's possible (even they are type aliases)
| if err != nil { | ||
| return nil, fmt.Errorf("invalid blob ID: %w", err) | ||
| } | ||
| log.Debugw("downloading fibre blob", "commitment", blbID.Commitment()) |
There was a problem hiding this comment.
will move and then remove it from here
| Upload(_ context.Context, _ libshare.Namespace, _ []byte, _ *txclient.TxConfig) (*UploadResult, error) | ||
| // Get retrieves a Fibre blob from FSPs by blobID. | ||
| // It reconstructs the original blob data from the encoded rows stored off-chain. | ||
| Get(ctx context.Context, blobID []byte) (*GetBlobResult, error) |
There was a problem hiding this comment.
Calling it Download like the client does would be slightly easier for us terminologically. The Get by itself doesn't do anything else but calls Download, so not much value giving it another name. Then if we refer to it as Download we know its equivalent to client's download
| ns libshare.Namespace, | ||
| data []byte, | ||
| _ *txclient.TxConfig, | ||
| ) (_ *appfibre.SignedPaymentPromise, _ appfibre.BlobID, err error) { |
There was a problem hiding this comment.
nit: you can technically retrieve blobId from PaymentPromise, we could even add a BlobID method to it. BlobID is Comm + BlobVer and both are fields of PP.
For the external api in the module, it is still makes sense to keep BlobID as independent field, but for the intermal service we could deduplicate things amd debloat function signature
| } | ||
|
|
||
| func (a *AccountClient) QueryEscrowAccount(ctx context.Context, signer string) (_ *EscrowAccount, err error) { | ||
| if a == nil { |
There was a problem hiding this comment.
a bit confused how is it possible for AccountClient to be nil but not for the entire service. When grpc address is not supplied? But then we can't still send PFF txs right? Or do you want to keep it for reads? We may want to protect the Upload/Submit with ErrNoClient as well
There was a problem hiding this comment.
It's more a guard rather than smth specific. But I agree, that we should keep consistency. Will add the same condition to Upload/Submit
Resolves https://linear.app/celestia/issue/PROTOCO-1332/implement-fibre-module