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

[FreshEyes] locks: introduce mutex for tx download, flush rejection filters on UpdatedBlockTip #17

Open
wants to merge 7 commits into
base: bitcoin-fresheyes-staging-master-30111
Choose a base branch
from

Commits on May 20, 2024

  1. guard TxRequest and rejection caches with new mutex

    We need to synchronize between various tx download structures.
    TxRequest does not inherently need cs_main for synchronization, and it's
    not appropriate to lock all of the tx download logic under cs_main.
    glozow committed May 20, 2024
    Configuration menu
    Copy the full SHA
    b5009a7 View commit details
    Browse the repository at this point in the history
  2. add ValidationInterface::UpdatedBlockTipSync

    This is a synchronous version of UpdatedBlockTip.
    
    It allows clients to respond to a new block immediately after it is
    connected. The synchronicity is important for things like
    m_recent_rejects, in which a transaction's validity can change (rejected
    vs accepted) when this event is processed (e.g. it has a timelock
    condition that has just been met). This is distinct from something like
    m_recent_confirmed_transactions in which the validation outcome is the
    same (valid vs already-have).
    glozow committed May 20, 2024
    Configuration menu
    Copy the full SHA
    9d413af View commit details
    Browse the repository at this point in the history
  3. update recent_rejects filters on UpdatedBlockTipSync

    Resetting m_recent_rejects once per block is more efficient than
    comparing hashRecentRejectsChainTip with the chain tip every time we
    call AlreadyHaveTx. We keep hashRecentRejectsChainTip for now to assert
    that updates happen correctly; it is removed in the next commit.
    glozow committed May 20, 2024
    Configuration menu
    Copy the full SHA
    57a42b0 View commit details
    Browse the repository at this point in the history
  4. remove obsoleted hashRecentRejectsChainTip

    This also means AlreadyHaveTx no longer needs cs_main held.
    glozow committed May 20, 2024
    Configuration menu
    Copy the full SHA
    e668575 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ba3b604 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    879f5db View commit details
    Browse the repository at this point in the history
  7. scripted-diff: rename TxOrphanage::EraseTxNoLock to EraseTxInternal

    The lock doesn't exist anymore.
    
    -BEGIN VERIFY SCRIPT-
    sed -i 's/EraseTxNoLock/EraseTxInternal/g' src/txorphanage.*
    -END VERIFY SCRIPT-))'
    glozow committed May 20, 2024
    Configuration menu
    Copy the full SHA
    7c3fb97 View commit details
    Browse the repository at this point in the history