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

feat(blockprod): Revised Approach for Madara Block Production Shutdown #458

Open
Tracked by #413
Mohiiit opened this issue Jan 9, 2025 · 0 comments · May be fixed by #468
Open
Tracked by #413

feat(blockprod): Revised Approach for Madara Block Production Shutdown #458

Mohiiit opened this issue Jan 9, 2025 · 0 comments · May be fixed by #468
Assignees
Labels
db-migration Requires database schema changes or migration help-wanted Looking for contributors to help with this sequencer Related to the sequencing logic and implementation

Comments

@Mohiiit
Copy link
Contributor

Mohiiit commented Jan 9, 2025

Description

This issue outlines a revised approach to handle block production shutdowns in Madara, improving on our previous proposal. The main goal is to eliminate transaction re-execution to preserve receipt consistency and ensure efficient handling of both graceful and ungraceful shutdown scenarios.

The revised approach shifts block sealing logic to the restart phase and introduces configuration-based decision-making, allowing for seamless block production handling even when configurations change.

Key changes in this proposal include:

  1. No Block Sealing During Shutdown (whether graceful or ungraceful).
  2. On Restart:
    • seal the block irrespective of the config, because closing the block doesn't depend on the configs.

Proposed Solution

Key Changes

  • Avoid sealing blocks during both graceful and ungraceful shutdowns.
  • On restart, seal the block and make sure we have updated the db for the pending txns and classes etc.

Data Persistence Requirements

  • Persist pending transactions and their receipts in the database.
  • Do not clear the database on restart to avoid unnecessary transaction re-execution.

Pseudo-Code Overview

async fn handle_restart() {
    seal_the_last_block();
    start_an_empty_block();
}
@Trantorian1 Trantorian1 added help-wanted Looking for contributors to help with this sequencer Related to the sequencing logic and implementation db-migration Requires database schema changes or migration labels Jan 9, 2025
@Trantorian1 Trantorian1 self-assigned this Jan 15, 2025
@Trantorian1 Trantorian1 moved this to In progress in Madara Jan 15, 2025
@Trantorian1 Trantorian1 changed the title Block Production Shutdown: Revised Approach for Madara feat(blockprod): Revised Approach for Madara Block Production Shutdown Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db-migration Requires database schema changes or migration help-wanted Looking for contributors to help with this sequencer Related to the sequencing logic and implementation
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

2 participants