Skip to content
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

feat(node): Add shwap data types #169

Merged
merged 21 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ static CUSTOM_TYPE_ATTRIBUTES: &[(&str, &str)] = &[
(".share.eds.byzantine.pb.Share", SERIALIZED),
(".proof.pb.Proof", SERIALIZED),
(".share.p2p.shrex.nd.NamespaceRowResponse", SERIALIZED),
(".share.p2p.shwap.Row", SERIALIZED),
(".share.p2p.shwap.Sample", SERIALIZED),
(".share.p2p.shwap.Data", SERIALIZED),
];

#[rustfmt::skip]
Expand Down Expand Up @@ -83,6 +86,7 @@ fn main() -> Result<()> {
"vendor/celestia/blob/v1/tx.proto",
"vendor/header/pb/extended_header.proto",
"vendor/share/p2p/shrexnd/pb/share.proto",
"vendor/share/p2p/shwap/pb/shwap.proto",
"vendor/share/eds/byzantine/pb/share.proto",
"vendor/cosmos/base/v1beta1/coin.proto",
"vendor/cosmos/base/abci/v1beta1/abci.proto",
Expand Down
28 changes: 28 additions & 0 deletions proto/vendor/share/p2p/shwap/pb/shwap.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
syntax = "proto3";

// TODO: current celestia-node PR doesn't specify the package, we might want to align on it
package share.p2p.shwap;
import "pb/proof.proto"; // celestiaorg/nmt/pb/proof.proto

message Row {
bytes row_id = 1;
repeated bytes row_half = 2;
}

enum SampleProofType {
RowSampleProofType = 0;
ColSampleProofType = 1;
}

message Sample {
bytes sample_id = 1;
SampleProofType sample_type = 2;
bytes sample_share = 3;
proof.pb.Proof sample_proof = 4;
}

message Data {
bytes data_id = 1;
repeated bytes data_shares = 2;
proof.pb.Proof data_proof = 3;
}
10 changes: 9 additions & 1 deletion tools/update-proto-vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ extract_urls ../target/proto-vendor-src \
https://github.com/cosmos/cosmos-proto/archive/refs/tags/v1.0.0-alpha4.tar.gz \
https://github.com/cosmos/gogoproto/archive/refs/tags/v1.4.11.tar.gz \
https://github.com/celestiaorg/go-header/archive/refs/heads/main.tar.gz \
https://github.com/googleapis/googleapis/archive/refs/heads/master.tar.gz
https://github.com/googleapis/googleapis/archive/refs/heads/master.tar.gz \
https://codeload.github.com/celestiaorg/celestia-node/zip/refs/heads/hlib/v2-prototype

mkdir -p vendor

Expand Down Expand Up @@ -70,6 +71,13 @@ for pb_dir in ../target/proto-vendor-src/celestia-node-main/share/*/*/pb; do
cp -r "$pb_dir" "$out_dir"
done

# TODO: replace with version from main, once it is merged
# https://github.com/celestiaorg/celestia-node/pull/2675
rm -rf vendor/share/p2p/shwap
mkdir -p vendor/share/p2p/shwap/pb
cp ../target/proto-vendor-src/celestia-node-hlib-v2-prototype/share/shwap/pb/shwap_pb.proto \
vendor/share/p2p/shwap/pb/shwap.proto

rm -rf vendor/tendermint
cp -r ../target/proto-vendor-src/celestia-core-0.34.x-celestia/proto/tendermint vendor

Expand Down
Loading
Loading