/
execution.proto
125 lines (106 loc) · 4.24 KB
/
execution.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
syntax = 'proto3';
package astria.execution.v1alpha2;
import "astria/sequencerblock/v1alpha1/block.proto";
import "google/protobuf/timestamp.proto";
// GenesisInfo contains the information needed to start a rollup chain.
//
// This information is used to determine which sequencer & celestia data to
// use from the Astria & Celestia networks.
message GenesisInfo {
// The rollup_id is the unique identifier for the rollup chain.
bytes rollup_id = 1;
// The first block height of sequencer chain to use for rollup transactions.
uint32 sequencer_genesis_block_height = 2;
// The first block height of celestia chain to use for rollup transactions.
uint32 celestia_base_block_height = 3;
// The allowed variance in celestia for sequencer blocks to have been posted.
uint32 celestia_block_variance = 4;
}
// The set of information which deterministic driver of block production
// must know about a given rollup Block
message Block {
// The block number
uint32 number = 1;
// The hash of the block
bytes hash = 2;
// The hash from the parent block
bytes parent_block_hash = 3;
// Timestamp on the block, standardized to google protobuf standard.
google.protobuf.Timestamp timestamp = 4;
}
// Fields which are indexed for finding blocks on a blockchain.
message BlockIdentifier {
oneof identifier {
uint32 block_number = 1;
bytes block_hash = 2;
}
}
message GetGenesisInfoRequest {}
// Used in GetBlock to find a single block.
message GetBlockRequest {
BlockIdentifier identifier = 1;
}
// Used in BatchGetBlocks, will find all or none based on the list of
// identifiers.
message BatchGetBlocksRequest {
repeated BlockIdentifier identifiers = 1;
}
// The list of blocks in response to BatchGetBlocks.
message BatchGetBlocksResponse {
repeated Block blocks = 1;
}
// ExecuteBlockRequest contains all the information needed to create a new rollup
// block.
//
// This information comes from previous rollup blocks, as well as from sequencer
// blocks.
message ExecuteBlockRequest {
// The hash of previous block, which new block will be created on top of.
bytes prev_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;
}
// The CommitmentState holds the block at each stage of sequencer commitment
// level
//
// A Valid CommitmentState:
// - Block numbers are such that soft >= firm.
// - No blocks ever decrease in block number.
// - The chain defined by soft is the head of the canonical chain the firm block
// must belong to.
message CommitmentState {
// Soft commitment is the rollup block matching latest sequencer block.
Block soft = 1;
// Firm commitment is achieved when data has been seen in DA.
Block firm = 2;
}
// There is only one CommitmentState object, so the request is empty.
message GetCommitmentStateRequest {}
// The CommitmentState to set, must include complete state.
message UpdateCommitmentStateRequest {
CommitmentState commitment_state = 1;
}
// ExecutionService is used to drive deterministic production of blocks.
//
// The service can be implemented by any blockchain which wants to utilize the
// Astria Shared Sequencer, and will have block production driven via the Astria
// "Conductor".
service ExecutionService {
// GetGenesisInfo returns the necessary genesis information for rollup chain.
rpc GetGenesisInfo(GetGenesisInfoRequest) returns (GenesisInfo);
// GetBlock will return a block given an identifier.
rpc GetBlock(GetBlockRequest) returns (Block);
// BatchGetBlocks will return an array of Blocks given an array of block
// identifiers.
rpc BatchGetBlocks(BatchGetBlocksRequest) returns (BatchGetBlocksResponse);
// ExecuteBlock is called to deterministically derive a rollup block from
// filtered sequencer block information.
rpc ExecuteBlock(ExecuteBlockRequest) returns (Block);
// GetCommitmentState fetches the current CommitmentState of the chain.
rpc GetCommitmentState(GetCommitmentStateRequest) returns (CommitmentState);
// UpdateCommitmentState replaces the whole CommitmentState with a new
// CommitmentState.
rpc UpdateCommitmentState(UpdateCommitmentStateRequest) returns (CommitmentState);
}