feat: Celestia DA Layer Client implementation#399
Conversation
043b5f7 to
6332ab9
Compare
Codecov Report
@@ Coverage Diff @@
## main #399 +/- ##
==========================================
+ Coverage 56.62% 56.74% +0.12%
==========================================
Files 44 49 +5
Lines 7518 7907 +389
==========================================
+ Hits 4257 4487 +230
- Misses 2655 2781 +126
- Partials 606 639 +33
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
LGTM. I've tested this against ephemeral cluster myself and tested it with Ethermint. Both work.
Long term we should consider moving libs/cnrc to a separate repo
Edit: Tomasz is of course ahead of me https://github.com/orgs/celestiaorg/discussions/409
cbe358a to
16aa9cf
Compare
| return da.ResultSubmitBlock{ | ||
| DAResult: da.DAResult{ | ||
| Code: da.StatusSuccess, | ||
| Message: "tx hash: " + txResponse.TxHash, |
There was a problem hiding this comment.
It's a bit weird to use this field for everything. but OK for this PR.
There was a problem hiding this comment.
Well, TBH it's just a message. We don't need this hash anyways, I just wanted to add something useful, that may be helpful with debugging.
| } | ||
|
|
||
| // callNamespacedEndpoint fetches result of /namespaced_{type} family of endpoints into result (this should be pointer!) | ||
| func (c *Client) callNamespacedEndpoint(ctx context.Context, namespaceID [8]byte, height uint64, endpoint string, result interface{}) error { |
There was a problem hiding this comment.
Ideally, that 8 would be a const or rather using an existing const.
There was a problem hiding this comment.
Created follow-up issue (#411) as this is used literally everywhere.
To run the test, running celestia node is needed, version from: celestiaorg/celestia-node#693
Co-authored-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
fab29d3 to
ff8fd97
Compare
This PR introduces celestia DA layer client implementation, based on celestia-node RPC.
It was tested manually with ephemeral cluster using latest & greatest celestia-node and celestia-app.
Main components:
da/celestia- implementation of DA interfaceda/celestia/mock- mock celestia-node RPC server (for testing)libs/cnrc- Celestia Node RPC Client. This is a simple abstraction ti hide complexity related to calling HTTP endpoints, serialization, etc. Right now it's tested viada/test. My intention is to extract this a a separate library, because it probably can be reused. Only used methods are implemented.Resolves: #396