github bestinslot-xyz/brc20-programmable-module v0.16.7

3 hours ago

Bug Fixes

  • an interrupted commit or reorg is rolled back when the database next opens
    • brc20_commitToDatabase and brc20_reorg record the height to fall back to in the
      global database before their first write, and clear it once every write is synced.
      Opening a database that still holds it reorgs back to that height, so a crash, kill or
      power cut midway never leaves a block's height recorded without its state.
    • Each database writes its changes as whole synced batches: a cached database writes
      its histories, then its values, then the deletion of old histories. The state
      databases go first, and block_number_to_hash, which sets the reported height, goes
      last.
    • When the first commit into an empty database was interrupted, or an interrupted
      commit or reorg has a target more than 10 blocks below the highest finalised block,
      opening wipes the module's databases with a warning, and the indexer replays from its
      activation height. Other files in the data directory stay, and an interrupted wipe
      finishes on the next open.
    • After a commit or reorg fails partway, the same process refuses every read and write
      except clearing caches until the database is reopened.
    • The highest finalised block only ever rises, so a reorg after a replay of a lower
      chain stays within the pruned history. It is stored with each commit's rollback
      marker, so blocks finalised but lost in a crash do not narrow the reorgs allowed.
    • A database directory that is a symbolic link to a database is emptied by a wipe, and
      the link kept. A link to anything else stops the wipe before anything is deleted.
    • A commit syncs the WAL of every database it writes, 20 syncs for a signet block of
      five deposits. The on-disk layout is unchanged.
    • v0.16.6 and earlier ignore the rollback marker: open a store that crashed under this
      version with this version or a later one.
  • Each database writes its changes as whole synced batches: a cached database writes
    its histories, then its values, then the deletion of old histories. The state
    databases go first, and block_number_to_hash, which sets the reported height, goes
    last.
  • When the first commit into an empty database was interrupted, or an interrupted
    commit or reorg has a target more than 10 blocks below the highest finalised block,
    opening wipes the module's databases with a warning, and the indexer replays from its
    activation height. Other files in the data directory stay, and an interrupted wipe
    finishes on the next open.
  • After a commit or reorg fails partway, the same process refuses every read and write
    except clearing caches until the database is reopened.
  • The highest finalised block only ever rises, so a reorg after a replay of a lower
    chain stays within the pruned history. It is stored with each commit's rollback
    marker, so blocks finalised but lost in a crash do not narrow the reorgs allowed.
  • A database directory that is a symbolic link to a database is emptied by a wipe, and
    the link kept. A link to anything else stops the wipe before anything is deleted.
  • A commit syncs the WAL of every database it writes, 20 syncs for a signet block of
    five deposits. The on-disk layout is unchanged.
  • v0.16.6 and earlier ignore the rollback marker: open a store that crashed under this
    version with this version or a later one.
  • A BitcoinRpc error during eth_call, eth_callMany, eth_estimateGas,
    eth_estimateGasMany or brc20_balance is retried once with no pause, and then
    fails the whole call with Call failed: Bitcoin data unavailable.
    brc20_balance reaches no Bitcoin precompile today.
  • The eth_estimateGas and eth_estimateGasMany gas search returns that error as soon
    as a lookup fails, instead of reading it as too little gas.
  • During block execution a BitcoinRpc error is retried five times, one second
    apart, and then panics, as before.

Commit Statistics

  • 2 commits contributed to the release.
  • 2 days passed between releases.
  • 0 commits were understood as conventional.
  • 2 unique issues were worked on: #27, #31

Commit Details

view details
  • #27
    • Fail a public call on a Bitcoin lookup error instead of panicking (11aabd3)
  • #31
    • Recover an interrupted commit or reorg at open, keeping the storage layout (1f17498)

Don't miss a new brc20-programmable-module release

NewReleases is sending notifications on new releases.