@@ -15,21 +15,29 @@ type Sequencer interface {
1515// SequencerInput provides a method for submitting a transaction from rollup to sequencer
1616type SequencerInput interface {
1717 // 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 )
1922}
2023
2124// SequencerOutput provides a method for getting the next batch of transactions from sequencer to rollup
2225type SequencerOutput interface {
2326 // 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
2530 // 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 )
2732}
2833
2934// BatchVerifier provides a method for verifying a batch of transactions received from the sequencer
3035type BatchVerifier interface {
3136 // 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 )
3341}
3442
3543// RollupId is a unique identifier for a rollup chain
@@ -45,3 +53,37 @@ type Hash = []byte
4553type Batch struct {
4654 Transactions []Tx
4755}
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