rollkit / go-sequencing

Generic sequencer interface for modular blockchains
Apache License 2.0
6 stars 2 forks source link

rollup id with every api or a new config api to pass rollup id #10

Open gupadhyaya opened 1 month ago

gupadhyaya commented 1 month ago

Currently only SubmitRollupTx api is passed with rollup id and other apis such as GetNextBatch and VerifyBatch are not passed with rollup id. The implementation of the sequencing api is expected to maintain a state (rollup id) to serve the subsequent api calls GetNextBatch and VerifyBatch. There are two alternative designs: 1) rollup id is passed with every sequencing api (similar to how namespace is passed with every go-da api) 2) introduce a new config api to pass rollup id

gupadhyaya commented 1 month ago

Given the typical use cases for a sequencer, passing the RollupId in every API call is generally the better choice for flexibility, simplicity, and statelessness. It makes the API more versatile and easier to use in various scenarios, including those where multiple rollups are involved. It also adheres to the principle of explicitness, where the caller has full control over the context in which each operation occurs.

However, if the sequencer is specifically designed to work with only one rollup and the RollupId is unlikely to change, managing it within the implementation’s state can reduce boilerplate and make the API easier to use. In such cases, you might provide a method to set or change the RollupId if needed, while keeping the interface simpler.