Skip to content

Commit

Permalink
Consolidating proto definitions in astria-proto, and add CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joroshiba committed May 20, 2023
1 parent c2b22f0 commit a45254c
Show file tree
Hide file tree
Showing 23 changed files with 75 additions and 113 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/proto.yml
@@ -0,0 +1,30 @@
name: buf
on:
pull_request:
push:
branches:
- main
jobs:
build-lint-push-protos:
runs-on: ubuntu-latest
environment: BUF
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
with:
version: "1.15.1"
github_token: ${{ github.token }}
- uses: bufbuild/buf-lint-action@v1
with:
input: "crates/astria-proto"
# TODO(GH-29): Uncomment out after reaching any production stage
# - uses: bufbuild/buf-breaking-action@v1
# with:
# # The 'main' branch of the GitHub repository that defines the module.
# input: "crates/astria-proto/proto"
# against: "https://github.com/astriaorg/astria.git#branch=main,ref=HEAD~1,subdir=crates/astria-proto/proto"
- uses: bufbuild/buf-push-action@v1
with:
draft: ${{ github.ref_name != 'main'}}
input: "crates/astria-proto/proto"
buf_token: ${{ secrets.BUF_TOKEN }}
88 changes: 12 additions & 76 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Expand Up @@ -3,10 +3,9 @@
members = [
"crates/astria-conductor",
"crates/astria-conductor-test",
"crates/astria-execution-apis-rpc",
"crates/astria-gossipnet",
"crates/astria-proto",
"crates/astria-rs-cnc",
"crates/astria-sequencer-relayer",
"crates/astria-sequencer-relayer-proto",
"crates/astria-sequencer-relayer-test",
]
3 changes: 1 addition & 2 deletions crates/astria-conductor/Cargo.toml
Expand Up @@ -25,11 +25,10 @@ tonic = "0.8.3"
tracing = "0.1.37"
tracing-subscriber = "0.3.16"

astria-execution-apis-rpc = { path = "../astria-execution-apis-rpc" }
astria-proto = { path = "../astria-proto" }
astria-gossipnet = { path = "../astria-gossipnet" }
astria-rs-cnc = { path = "../astria-rs-cnc" }
astria-sequencer-relayer = { path = "../astria-sequencer-relayer" }
astria-sequencer-relayer-proto = { path = "../astria-sequencer-relayer-proto" }

[dev-dependencies]
astria-conductor-test = { path = "../astria-conductor-test" }
2 changes: 1 addition & 1 deletion crates/astria-conductor/src/execution_client.rs
@@ -1,4 +1,4 @@
use astria_execution_apis_rpc::execution::{
use astria_proto::execution::v1::{
execution_service_client::ExecutionServiceClient,
DoBlockRequest,
DoBlockResponse,
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-conductor/src/executor.rs
@@ -1,5 +1,6 @@
use std::collections::HashMap;

use astria_proto::sequencer::v1::SequencerMsg;
use astria_sequencer_relayer::{
base64_string::Base64String,
sequencer_block::{
Expand All @@ -10,7 +11,6 @@ use astria_sequencer_relayer::{
SequencerBlock,
},
};
use astria_sequencer_relayer_proto::SequencerMsg;
use color_eyre::eyre::{
Result,
WrapErr as _,
Expand Down
3 changes: 0 additions & 3 deletions crates/astria-execution-apis-rpc/src/lib.rs

This file was deleted.

@@ -1,15 +1,15 @@
[package]
name = "astria-execution-apis-rpc"
name = "astria-proto"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/astriaorg/astria-rpc"
repository = "https://github.com/astriaorg/astria"
homepage = "https://astria.org"
# TODO
# documentation = ""

categories = ["astria-execution-apis", "astria-rpc", "rpc-types"]
categories = ["astria-proto", "astria-rpc", "rpc-types"]
keywords = ["astria", "grpc", "rpc", "blockchain", "execution", "protobuf"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions crates/astria-proto/buf.work.yaml
@@ -0,0 +1,3 @@
version: v1
directories:
- proto
File renamed without changes.
@@ -1,6 +1,6 @@
syntax = 'proto3';

package execution.v1;
package astria.execution.v1;

import "google/protobuf/timestamp.proto";

Expand Down
@@ -1,7 +1,8 @@
// this is copied from astriorg's metro/pb/msg.proto

// this is (mostly) copied from astriorg's metro/pb/msg.proto
syntax = "proto3";

package astria.sequencer.v1;

message SequencerMsg {
bytes chain_id = 1;
bytes data = 2;
Expand Down
@@ -1,6 +1,9 @@
// these types are copy pasted from here: https://github.com/cosmos/cosmos-sdk/blob/v0.44.0/proto/cosmos/tx/v1beta1/tx.proto

syntax = "proto3";

package astria.sequencer.v1;

import "google/protobuf/any.proto";

// TxRaw is a variant of Tx that pins the signer's exact binary representation
Expand Down
2 changes: 2 additions & 0 deletions crates/astria-proto/proto/buf.lock
@@ -0,0 +1,2 @@
# Generated by buf. DO NOT EDIT.
version: v1
@@ -1,5 +1,5 @@
version: v1
name: buf.build/astria/execution-apis
name: buf.build/astria/astria
breaking:
use:
- FILE
Expand Down
11 changes: 11 additions & 0 deletions crates/astria-proto/src/lib.rs
@@ -0,0 +1,11 @@
pub mod execution {
pub mod v1 {
include!(concat!(env!("OUT_DIR"), "/astria.execution.v1.rs"));
}
}

pub mod sequencer {
pub mod v1 {
include!(concat!(env!("OUT_DIR"), "/astria.sequencer.v1.rs"));
}
}
13 changes: 0 additions & 13 deletions crates/astria-sequencer-relayer-proto/Cargo.toml

This file was deleted.

5 changes: 0 additions & 5 deletions crates/astria-sequencer-relayer-proto/build.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/astria-sequencer-relayer-proto/src/lib.rs

This file was deleted.

2 changes: 1 addition & 1 deletion crates/astria-sequencer-relayer/Cargo.toml
Expand Up @@ -28,7 +28,7 @@ http = "0.2.9"
tokio = { version = "1.24", features = [ "macros", "rt-multi-thread" ] }

astria-gossipnet = { path = "../astria-gossipnet", features = [ "mdns" ] }
astria-sequencer-relayer-proto = { path = "../astria-sequencer-relayer-proto" }
astria-proto = { path = "../astria-proto" }
astria-rs-cnc = { path = "../astria-rs-cnc" }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-sequencer-relayer/src/sequencer_block.rs
Expand Up @@ -3,7 +3,7 @@ use std::{
fmt,
};

use astria_sequencer_relayer_proto::{
use astria_proto::sequencer::v1::{
SequencerMsg,
TxBody,
TxRaw,
Expand Down

0 comments on commit a45254c

Please sign in to comment.