Skip to content
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

Implement MockDaService #585

Closed
2 of 5 tasks
bkolad opened this issue Jul 31, 2023 · 1 comment
Closed
2 of 5 tasks

Implement MockDaService #585

bkolad opened this issue Jul 31, 2023 · 1 comment

Comments

@bkolad
Copy link
Member

bkolad commented Jul 31, 2023

Background

To test a complete transaction processing workflow, we need to initiate a celesta service in an external docker container. As a result, we are unable to execute self-contained E2E unit tests for the rollup. To address this limitation, we should create a MockDaService that stores transaction blobs in memory. This will allow us to perform tests without relying on the external service.

Proposed solution:

  • 1. Extract the blob processing logic from demo-rollup. The logic should depend only on the DaService trait instead of a specific DA implementation. This abstract logic will reside in a separate crate (called rollup?), which will be responsible for "running" the rollup. Take a look at issue Move out custom rollup logic from demo-rollup and demo-prover  #459 for more details.
  • 2. Implementdemo-rollup using (1). The main function of the demo-rollup should take a runtime, rollup and specific da service (celestial for now) and seamlessly integrate them with very little custom logic involved.
  • 3. Implement the DaService trait for MockDaService. We can start from the following code.
  • 4. Test (1) with the MockDaService
  • 5. Use (1) & (3) for E2E tests for our runtime (including queries and send_transaction endpoints)
@citizen-stig citizen-stig changed the title Implemnet MockDaService Implement MockDaService Aug 1, 2023
@bkolad
Copy link
Member Author

bkolad commented Aug 8, 2023

For point 3 the MockDaService has to support at least the following methods:

let filtered_block = self.da_service.get_finalized_at(height).await?;
let mut blobs = self.da_service.extract_relevant_txs(&filtered_block);

Inside MockDaService we could keep a queue of pending blobs and index it by FileredBlock (TestBlock in MockDaService.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant