-
Notifications
You must be signed in to change notification settings - Fork 97
feat(proto): add bundle and optimistic block apis #1519
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
762 changes: 762 additions & 0 deletions
762
crates/astria-core/src/generated/astria.bundle.v1alpha1.rs
Large diffs are not rendered by default.
Oops, something went wrong.
651 changes: 651 additions & 0 deletions
651
crates/astria-core/src/generated/astria.bundle.v1alpha1.serde.rs
Large diffs are not rendered by default.
Oops, something went wrong.
506 changes: 506 additions & 0 deletions
506
crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.rs
Large diffs are not rendered by default.
Oops, something went wrong.
460 changes: 460 additions & 0 deletions
460
crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.serde.rs
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { | ||
| // 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); | ||
| } | ||
38 changes: 38 additions & 0 deletions
38
proto/executionapis/astria/bundle/v1alpha1/optimistic_execution.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } |
39 changes: 39 additions & 0 deletions
39
proto/sequencerblockapis/astria/sequencerblock/v1alpha1/optimistic_block.proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.