Skip to content

Commit 4e55181

Browse files
committed
chore: document the 2.x-nature of loading burnchain operations for Stacks
1 parent ca39248 commit 4e55181

File tree

1 file changed

+8
-2
lines changed
  • stackslib/src/chainstate/stacks/db

1 file changed

+8
-2
lines changed

stackslib/src/chainstate/stacks/db/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,8 @@ const CHAINSTATE_SCHEMA_3: &'static [&'static str] = &[
867867
// proessed
868868
r#"
869869
CREATE TABLE burnchain_txids(
870+
-- in epoch 2.x, this is the index block hash of the Stacks block.
871+
-- in epoch 3.x, this is the index block hash of the tenure-start block.
870872
index_block_hash TEXT PRIMARY KEY,
871873
-- this is a JSON-encoded list of txids
872874
txids TEXT NOT NULL
@@ -2494,7 +2496,7 @@ impl StacksChainState {
24942496
}
24952497

24962498
/// Get the burnchain txids for a given index block hash
2497-
fn get_burnchain_txids_for_block(
2499+
pub(crate) fn get_burnchain_txids_for_block(
24982500
conn: &Connection,
24992501
index_block_hash: &StacksBlockId,
25002502
) -> Result<Vec<Txid>, Error> {
@@ -2516,6 +2518,7 @@ impl StacksChainState {
25162518
}
25172519

25182520
/// Get the txids of the burnchain operations applied in the past N Stacks blocks.
2521+
/// Only works for epoch 2.x
25192522
pub fn get_burnchain_txids_in_ancestors(
25202523
conn: &Connection,
25212524
index_block_hash: &StacksBlockId,
@@ -2532,7 +2535,10 @@ impl StacksChainState {
25322535
Ok(ret)
25332536
}
25342537

2535-
/// Store all on-burnchain STX operations' txids by index block hash
2538+
/// Store all on-burnchain STX operations' txids by index block hash.
2539+
/// `index_block_hash` is the tenure-start block.
2540+
/// * For epoch 2.x, this is simply the block ID
2541+
/// * for epoch 3.x and later, this is the first block in the tenure.
25362542
pub fn store_burnchain_txids(
25372543
tx: &DBTx,
25382544
index_block_hash: &StacksBlockId,

0 commit comments

Comments
 (0)