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

Add transaction IDs to the chain tip channel #2686

Merged
merged 6 commits into from
Aug 30, 2021
Merged

Conversation

teor2345
Copy link
Contributor

Motivation

  1. We want to provide the mined transaction IDs for the chain tip as part of Get recent committed & rolled back blocks from the state service #2639

  2. We want to optimise chain tip updates, by re-using precalculated finalized and non-finalized block hashes, heights, and transaction IDs

Solution

  1. Add chain tip mined transaction IDs

  2. Optimisation:

    • Re-use finalized blocks for chain tip updates
    • Optimise tip sender equality checks
    • Re-use precalculated block hashes and heights for chain tip updates

This is part of #2639, but doesn't close that ticket.

Review

@jvff has been reviewing this series of chain tip updates PRs

This PR is based on PR #2683, it might need a manual rebase before it merges.

Reviewer Checklist

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

I modified the existing tests to cover the optimisations and the transaction hashes.

Follow Up Work

Handle chain tip resets (#2639)

@teor2345 teor2345 added A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement P-Medium labels Aug 27, 2021
@teor2345 teor2345 requested a review from jvff August 27, 2021 02:35
@teor2345 teor2345 self-assigned this Aug 27, 2021
@teor2345 teor2345 changed the title Chain tip transaction ids Add transaction IDs to the chain tip channel Aug 27, 2021
Base automatically changed from optimise-chain-updates to block-hash-chain-updates August 27, 2021 18:45
Base automatically changed from block-hash-chain-updates to main August 27, 2021 19:18
zebra-state/src/service/non_finalized_state.rs Outdated Show resolved Hide resolved
jvff
jvff previously approved these changes Aug 27, 2021
teor2345 and others added 5 commits August 30, 2021 09:56
@teor2345 teor2345 force-pushed the chain-tip-transaction-ids branch from e43a1c1 to e1d2153 Compare August 29, 2021 23:56
@teor2345 teor2345 enabled auto-merge (squash) August 30, 2021 01:47
@teor2345 teor2345 disabled auto-merge August 30, 2021 02:38
@teor2345 teor2345 merged commit 2e1d857 into main Aug 30, 2021
@teor2345 teor2345 deleted the chain-tip-transaction-ids branch August 30, 2021 02:38
@teor2345
Copy link
Contributor Author

Admin-merged after applying review suggestions and rebasing on the latest main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants