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(proto): add bundle and optimistic block apis #1519

Merged
merged 5 commits into from
Oct 2, 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
762 changes: 762 additions & 0 deletions crates/astria-core/src/generated/astria.bundle.v1alpha1.rs

Large diffs are not rendered by default.

651 changes: 651 additions & 0 deletions crates/astria-core/src/generated/astria.bundle.v1alpha1.serde.rs

Large diffs are not rendered by default.

506 changes: 506 additions & 0 deletions crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.rs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions crates/astria-core/src/generated/mod.rs

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

36 changes: 36 additions & 0 deletions proto/executionapis/astria/bundle/v1alpha1/bundle.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
syntax = "proto3";

package astria.bundle.v1alpha1;

message GetBundleStreamRequest {}

// Information for the bundle submitter to know how to submit the bundle.
// The fee and base_sequencer_block_hash are not necessarily strictly necessary
// it allows for the case where the server doesn't always send the highest fee
// bundles after the previous but could just stream any confirmed bundles.
message Bundle {
itamarreif marked this conversation as resolved.
Show resolved Hide resolved
// The fee that can be expected to be received for submitting this bundle.
// This allows the bundle producer to stream any confirmed bundles they would be ok
// with submitting. Used to avoid race conditions in received bundle packets. Could
// also be used by a bundle submitter to allow multiple entities to submit bundles.
uint64 fee = 1;
// The byte list of transactions to be included.
repeated bytes transactions = 2;
// The base_sequencer_block_hash is the hash from the base block this bundle
// is based on. This is used to verify that the bundle is based on the correct
// Sequencer block.
bytes base_sequencer_block_hash = 3;
// The hash of previous rollup block, on top of which the bundle will be executed as ToB.
bytes prev_rollup_block_hash = 4;
}

message GetBundleStreamResponse {
Bundle bundle = 1;
}

service BundleService {
// A bundle submitter requests bundles given a new optimistic Sequencer block,
// and receives a stream of potential bundles for submission, until either a timeout
// or the connection is closed by the client.
rpc GetBundleStream(GetBundleStreamRequest) returns (stream GetBundleStreamResponse);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
syntax = "proto3";

package astria.bundle.v1alpha1;

import "astria/execution/v1alpha2/execution.proto";
import "astria/sequencerblock/v1alpha1/block.proto";
import "google/protobuf/timestamp.proto";

// The "BaseBlock" is the information needed to simulate bundles on top of
// a Sequencer block which may not have been committed yet.
message BaseBlock {
// This is the block hash for the proposed block.
bytes sequencer_block_hash = 1;
// List of transactions to include in the new block.
repeated astria.sequencerblock.v1alpha1.RollupData transactions = 2;
// Timestamp to be used for new block.
google.protobuf.Timestamp timestamp = 3;
}

message ExecuteOptimisticBlockStreamRequest {
BaseBlock base_block = 1;
}

message ExecuteOptimisticBlockStreamResponse {
// Metadata identifying the block resulting from executing a block. Includes number, hash,
// parent hash and timestamp.
astria.execution.v1alpha2.Block block = 1;
// The base_sequencer_block_hash is the hash from the base sequencer block this block
// is based on. This is used to associate an optimistic execution result with the hash
// received once a sequencer block is committed.
bytes base_sequencer_block_hash = 2;
}

service OptimisticExecutionService {
// Stream blocks from the Auctioneer to Geth for optimistic execution. Geth will stream back
// metadata from the executed blocks.
rpc ExecuteOptimisticBlockStream(stream ExecuteOptimisticBlockStreamRequest) returns (stream ExecuteOptimisticBlockStreamResponse);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
syntax = "proto3";

package astria.sequencerblock.v1alpha1;

import "astria/primitive/v1/types.proto";
import "astria/sequencerblock/v1alpha1/block.proto";

message GetBlockCommitmentStreamRequest {}

// Identifying metadata for blocks that have been successfully committed in the Sequencer.
message SequencerBlockCommit {
// Height of the sequencer block that was committed.
uint64 height = 1;
// Hash of the sequencer block that was committed.
bytes block_hash = 2;
}

message GetBlockCommitmentStreamResponse {
SequencerBlockCommit commitment = 1;
}

message GetOptimisticBlockStreamRequest {
// The rollup id for which the Sequencer block is being streamed.
astria.primitive.v1.RollupId rollup_id = 1;
}

message GetOptimisticBlockStreamResponse {
// The optimistic Sequencer block that is being streamed, filtered for the provided rollup id.
astria.sequencerblock.v1alpha1.FilteredSequencerBlock block = 1;
}

// The Sequencer will serve this to the aucitoneer
service OptimisticBlockService {
// The Sequencer will stream the optimistic Sequencer block (filtered for the provided
// rollup id) to the Auctioneer.
rpc GetOptimisticBlockStream(GetOptimisticBlockStreamRequest) returns (stream GetOptimisticBlockStreamResponse);
// The Sequencer will stream the block commits to the Auctioneer.
rpc GetBlockCommitmentStream(GetBlockCommitmentStreamRequest) returns (stream GetBlockCommitmentStreamResponse);
}
Loading