IntersectMBO / IntersectMBO/ouroboros-consensus

Mempool could carry a single era block state always

Open
#348 1 comment 0 reactions 0 assignees View on GitHub
technical debt UTxO-HD
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

The Mempool is virtually just a block on top of the tip + 1 slot, therefore it lives in a single era. The internal state could carry a single era ledger state + tables, which would make revalidation for the hard fork block faster, going from this:

```
Syncing with the ledger consists of:
1. Consult txins (blk -> hf)
2. Read backing store (hf)
3. Forward them through db-changelog (hf)
4. Attach result to tip (hf)
5. Tick (hf)
6. Repeatedly *REAPPLY* (hf)
1. Unwrap HF state (hf -> blk) -- injection/translation every time
2. Call ledger reapplyTx (blk)
3. Compute diff (blk)
4. Attach diff to Tracking (blk -> hf)
5. Inject new values to Tracking (blk -> hf)
7. Store diffs (hf)
```

To this:
```
Syncing with the ledger consists of: (NEW)
1. Consult txins (blk -> hf)
2. Read backing store (hf)
3. Forward them through db-changelog (hf)
4. Attach result to tip (hf)
5. Tick (hf)
6. Unwrap HF state (hf -> blk) -- injection/translation once
7. Repeatedly *REAPPLY* (blk)
1. Call ledger applyTx (blk)
2. Compute diff (blk)
3. Attach diff to Tracking (blk)
4. Inject new values to Tracking (blk)
8. Store diffs (blk)
```

This might not be necessary depending on #347

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.