@@ -15,21 +15,29 @@ type Sequencer interface {
15
15
// SequencerInput provides a method for submitting a transaction from rollup to sequencer
16
16
type SequencerInput interface {
17
17
// SubmitRollupTransaction submits a transaction from rollup to sequencer
18
- SubmitRollupTransaction (ctx context.Context , rollupId RollupId , tx Tx ) error
18
+ // RollupId is the unique identifier for the rollup chain
19
+ // Tx is the transaction to submit
20
+ // returns an error if any from the sequencer
21
+ SubmitRollupTransaction (ctx context.Context , req SubmitRollupTransactionRequest ) (* SubmitRollupTransactionResponse , error )
19
22
}
20
23
21
24
// SequencerOutput provides a method for getting the next batch of transactions from sequencer to rollup
22
25
type SequencerOutput interface {
23
26
// GetNextBatch returns the next batch of transactions from sequencer to rollup
24
- // lastBatch is the last batch of transactions received from the sequencer
27
+ // RollupId is the unique identifier for the rollup chain
28
+ // LastBatchHash is the cryptographic hash of the last batch received by the rollup
29
+ // MaxBytes is the maximum number of bytes to return in the batch
25
30
// returns the next batch of transactions and an error if any from the sequencer
26
- GetNextBatch (ctx context.Context , lastBatchHash Hash ) (* Batch , time. Time , error )
31
+ GetNextBatch (ctx context.Context , req GetNextBatchRequest ) (* GetNextBatchResponse , error )
27
32
}
28
33
29
34
// BatchVerifier provides a method for verifying a batch of transactions received from the sequencer
30
35
type BatchVerifier interface {
31
36
// VerifyBatch verifies a batch of transactions received from the sequencer
32
- VerifyBatch (ctx context.Context , batchHash Hash ) (bool , error )
37
+ // RollupId is the unique identifier for the rollup chain
38
+ // BatchHash is the cryptographic hash of the batch to verify
39
+ // returns a boolean indicating if the batch is valid and an error if any from the sequencer
40
+ VerifyBatch (ctx context.Context , req VerifyBatchRequest ) (* VerifyBatchResponse , error )
33
41
}
34
42
35
43
// RollupId is a unique identifier for a rollup chain
@@ -45,3 +53,37 @@ type Hash = []byte
45
53
type Batch struct {
46
54
Transactions []Tx
47
55
}
56
+
57
+ // SubmitRollupTransactionRequest is a request to submit a transaction from rollup to sequencer
58
+ type SubmitRollupTransactionRequest struct {
59
+ RollupId RollupId
60
+ Tx Tx
61
+ }
62
+
63
+ // SubmitRollupTransactionResponse is a response to submitting a transaction from rollup to sequencer
64
+ type SubmitRollupTransactionResponse struct {
65
+ }
66
+
67
+ // GetNextBatchRequest is a request to get the next batch of transactions from sequencer to rollup
68
+ type GetNextBatchRequest struct {
69
+ RollupId RollupId
70
+ LastBatchHash Hash
71
+ MaxBytes uint64
72
+ }
73
+
74
+ // GetNextBatchResponse is a response to getting the next batch of transactions from sequencer to rollup
75
+ type GetNextBatchResponse struct {
76
+ Batch * Batch
77
+ Timestamp time.Time
78
+ }
79
+
80
+ // VerifyBatchRequest is a request to verify a batch of transactions received from the sequencer
81
+ type VerifyBatchRequest struct {
82
+ RollupId RollupId
83
+ BatchHash Hash
84
+ }
85
+
86
+ // VerifyBatchResponse is a response to verifying a batch of transactions received from the sequencer
87
+ type VerifyBatchResponse struct {
88
+ Status bool
89
+ }
0 commit comments