Closed trevorbernard closed 1 month ago
Related to #326 / #325
src/bin/mina-indexer.rs:264: let contents = std::fs::read(config_path)?;
src/bin/mina-indexer.rs:265: let args: ServerArgsJson = serde_json::from_slice(&contents)?;
src/bin/mina-indexer.rs:291: let config = process_indexer_configuration(args, mode, domain_socket_path.clone())?;
src/bin/mina-indexer.rs:292: let db = Arc::new(IndexerStore::new(&database_dir)?);
src/bin/mina-indexer.rs:311: remove_unix_socket(&domain_socket_path)?;
src/bin/mina-indexer.rs:333: serde_json::to_string(&version)?
src/bin/mina-indexer.rs:345: error!("Database dir {database_dir:#?} does not exist");
src/bin/mina-indexer.rs:347: info!("Creating snapshot of database dir {database_dir:#?}");
src/bin/mina-indexer.rs:348: let tmp_dir = TempDir::new()?;
src/bin/mina-indexer.rs:349: let db = IndexerStore::read_only(&database_dir, tmp_dir.as_ref())?;
src/bin/mina-indexer.rs:350: db.create_snapshot(&output_path)?;
src/bin/mina-indexer.rs:363: info!("Restoring mina indexer database from snapshot file {snapshot_file:#?} to {restore_dir:#?}");
src/bin/mina-indexer.rs:368: debug!("Ensuring mina indexer database exists in {database_dir:#?}");
src/bin/mina-indexer.rs:381: process_indexer_configuration((*args).into(), mode, domain_socket_path)?;
src/bin/mina-indexer.rs:383: debug!("Creating a new mina indexer database in {database_dir:#?}");
src/bin/mina-indexer.rs:384: let db = Arc::new(IndexerStore::new(&database_dir)?);
src/bin/mina-indexer.rs:436: debug!("Ensuring blocks directory exists: {blocks_dir:#?}");
src/bin/mina-indexer.rs:444: debug!("Ensuring staking ledgers directory exists: {staking_ledgers_dir:#?}");
src/bin/mina-indexer.rs:452: let genesis_constants = protocol_constants(args.db.genesis_constants)?;
src/bin/mina-indexer.rs:460: let genesis_ledger = parse_genesis_ledger(args.db.genesis_ledger)?;
src/bin/mina-indexer.rs:486: assert!(path.is_file(), "Ledger file does not exist at {path:#?}");
src/bin/mina-indexer.rs:487: info!("Parsing ledger file at {path:#?}");
src/bin/mina-indexer.rs:503: GenesisRoot::from_str(GenesisLedger::MAINNET_V1_GENESIS_LEDGER_CONTENTS)?;
src/bin/mina-indexer.rs:519: serde_json::to_string_pretty(&constants)?
src/bin/mina-indexer.rs:525: serde_json::to_string_pretty(&constants)?
src/bin/mina-indexer.rs:534: let content = fs::read_to_string(pid_path)?;
src/bin/mina-indexer.rs:535: let pid = content.trim().parse()?;
src/bin/mina-indexer.rs:541: let mut pid_file = File::create(pid_path)?;
src/bin/mina-indexer.rs:543: write!(pid_file, "{pid}")?;
src/bin/mina-indexer.rs:575: error!("Failed to create database directory in {database_dir:?}: {e}");
src/bin/mina-indexer.rs:587: error!("Error writing PID to {pid_path:?}: {e}");
src/block/blockchain_length.rs:36: } = serde_json::from_slice(&std::fs::read(path)?)?;
src/block/blockchain_length.rs:37: Ok(Self(blockchain_length.parse()?))
src/block/blockchain_length.rs:85: } = serde_json::from_slice(&std::fs::read(&path)?)?;
src/block/blockchain_length.rs:86: let pcb = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/block/blockchain_length.rs:88: assert_eq!(blockchain_length.parse::<u32>()?, pcb.blockchain_length());
src/block/vrf_output.rs:29: Ok(Self(b64.decode(input)?))
src/block/precomputed.rs:140: } = serde_json::from_slice(&block_file_contents.contents)?;
src/block/precomputed.rs:155: } = serde_json::from_slice(&block_file_contents.contents)?;
src/block/precomputed.rs:183: )?;
src/block/precomputed.rs:192: let contents = std::fs::read(path)?;
src/block/precomputed.rs:201: )?;
src/block/precomputed.rs:527: // TODO add mainnet end slot height?
src/block/precomputed.rs:747: let block = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/block/previous_state_hash.rs:20: let bytes = &std::fs::read(path)?;
src/block/previous_state_hash.rs:25: } = serde_json::from_slice(bytes)?;
src/block/previous_state_hash.rs:64: glob::glob("./tests/data/canonical_chain_discovery/contiguous/*.json")?
src/block/previous_state_hash.rs:69: let previous_state_hash = PreviousStateHash::from_path(&path)?.0;
src/block/previous_state_hash.rs:70: let block = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/block/mod.rs:53: let res = String::from_utf8(bytes.to_vec())?;
src/block/mod.rs:309: write!(f, "BlockHash {{ {:?} }}", self.0)
src/block/mod.rs:321: let last_part = file_name.to_str()?.split('-').last()?.to_string();
src/block/mod.rs:322: let state_hash = last_part.split('.').next()?;
src/block/mod.rs:332: .to_str()?
src/block/mod.rs:381: get_blockchain_length(path.file_name()?)
src/block/mod.rs:475: let block0: Block = PrecomputedBlock::parse_file(&path0, PcbVersion::V1)?.into();
src/block/mod.rs:476: let block1: Block = PrecomputedBlock::parse_file(&path1, PcbVersion::V1)?.into();
src/block/mod.rs:477: let block2: Block = PrecomputedBlock::parse_file(&path2, PcbVersion::V1)?.into();
src/block/mod.rs:485: let block0: Block = PrecomputedBlock::parse_file(&path0, PcbVersion::V1)?.into();
src/block/mod.rs:486: let block1: Block = PrecomputedBlock::parse_file(&path1, PcbVersion::V1)?.into();
src/block/mod.rs:498: assert_eq!(input, BlockHash::from_bytes(&bytes)?, "from_bytes");
src/block/genesis.rs:26: )?,
src/block/parser.rs:118: let mut paths: Vec<PathBuf> = glob(&format!("{}/*-*-*.json", blocks_dir.display()))?
src/block/parser.rs:156: let mut paths: Vec<PathBuf> = glob(&format!("{}/*-*-*.json", blocks_dir.display()))?
src/block/parser.rs:169: bail!("blocks_dir: {:?}, does not exist!", blocks_dir)
src/block/parser.rs:189: let paths: Vec<PathBuf> = glob(&pattern)?.filter_map(|x| x.ok()).collect();
src/block/parser.rs:268: .await?
src/block/parser.rs:270: .ok_or(anyhow!("Did not find state hash: {state_hash}"))?;
src/block/parser.rs:275: .await?
src/block/parser.rs:277: .ok_or(anyhow!("Did not find state hash: {state_hash}"))?;
src/block/parser.rs:425: let paths: Vec<PathBuf> = glob::glob("./tests/data/non_sequential_blocks/*")?
src/canonicity/canonical_chain_discovery.rs:33: "{} blocks sorted by length in {:?}",
src/canonicity/canonical_chain_discovery.rs:146: "Found {} deep canonical blocks in {:?}",
src/canonicity/canonical_chain_discovery.rs:155: let parent_hash = PreviousStateHash::from_path(curr_path)?.0;
src/canonicity/canonical_chain_discovery.rs:182: let prev_hash = PreviousStateHash::from_path(curr_path)?.0;
src/canonicity/canonical_chain_discovery.rs:195: "Found {} blocks in the canonical chain in {:?}",
src/client.rs:422: let encoded = bincode::encode_to_vec(self, BIN_CODE_CONFIG)?;
src/client.rs:424: writer.write_all(&encoded).await?;
src/client.rs:425: reader.read_to_end(&mut buffer).await?;
src/client.rs:427: let msg = String::from_utf8(buffer)?;
src/command/internal/mod.rs:249: let block = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/command/mod.rs:644: println!("s: {source:?}");
src/command/mod.rs:645: println!("r: {receiver:?}");
src/command/mod.rs:655: println!("d: {delegate:?}");
src/command/mod.rs:656: println!("t: {delegator:?}");
src/command/mod.rs:883: let contents = std::fs::read(path.clone())?;
src/command/mod.rs:885: from_slice::<Value>(&contents)?["staged_ledger_diff"]["diff"][0]["commands"][0].clone();
src/command/mod.rs:886: let block = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/command/signed.rs:132: bin_prot::to_writer(&mut binprot_bytes, &self.0).map_err(anyhow::Error::from)?;
src/event/witness_tree.rs:28: "best_tip: {}\ncanonical_blocks: {:?}",
src/event/db.rs:63: Self::Block(db_block_event) => write!(f, "{:?}", db_block_event),
src/event/db.rs:64: Self::Canonicity(db_canonicity_event) => write!(f, "{:?}", db_canonicity_event),
src/event/db.rs:65: Self::Ledger(db_ledger_event) => write!(f, "{:?}", db_ledger_event),
src/event/db.rs:66: Self::StakingLedger(db_ledger_event) => write!(f, "{:?}", db_ledger_event),
src/event/mod.rs:52: Self::Db(db_event) => write!(f, "{:?}", db_event),
src/event/mod.rs:53: Self::WitnessTree(tree_event) => write!(f, "{:?}", tree_event),
src/ledger/diff/mod.rs:147: writeln!(f, "=== LedgerDiff ===")?;
src/ledger/diff/mod.rs:149: writeln!(f, "{account_diff:?}")?;
src/ledger/diff/mod.rs:169: let block = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/ledger/diff/mod.rs:217: let block = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/ledger/diff/account.rs:335: "{} | {:?} | {}",
src/ledger/diff/account.rs:366: AccountDiff::Payment(pay_diff) => write!(f, "Payment: {pay_diff:?}"),
src/ledger/diff/account.rs:368: AccountDiff::Delegation(del_diff) => write!(f, "Delegation: {del_diff:?}"),
src/ledger/diff/account.rs:369: AccountDiff::Coinbase(coin_diff) => write!(f, "Coinbase: {coin_diff:?}"),
src/ledger/diff/account.rs:370: AccountDiff::FeeTransfer(pay_diff) => write!(f, "Fee transfer: {pay_diff:?}"),
src/ledger/diff/account.rs:372: write!(f, "Fee transfer via coinbase: {pay_diff:?}")
src/ledger/diff/account.rs:375: write!(f, "Failed transaction: {failed_diff:?}")
src/ledger/diff/account.rs:549: let block = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/ledger/mod.rs:65: let hash = String::from_utf8(bytes)?;
src/ledger/mod.rs:113: ledger._apply_diff(diff)?;
src/ledger/mod.rs:119: self._apply_diff(&diff)?;
src/ledger/mod.rs:236: Self::from_str(&String::from_utf8(bytes.to_vec())?)
src/ledger/mod.rs:254: let deser: HashMap<String, Account> = serde_json::from_str(s)?;
src/ledger/mod.rs:268: "[Ledger.eq mismatch] {pk:?} | {:?} | {:?}",
src/ledger/mod.rs:278: "[Ledger.eq mismatch] {pk:?} | {:?} | {:?}",
src/ledger/mod.rs:294: writeln!(f, "{} -> {}", pk.to_address(), acct.balance.0)?;
src/ledger/mod.rs:296: writeln!(f)?;
src/ledger/genesis.rs:177: let data = std::fs::read(path)?;
src/ledger/genesis.rs:178: Ok(serde_json::from_slice(&data)?)
src/ledger/genesis.rs:228: let root: GenesisRoot = serde_json::from_str(ledger_json)?;
src/ledger/genesis.rs:263: )?)?);
src/ledger/genesis.rs:269: serde_json::from_slice::<GenesisConstants>(&std::fs::read(some_path)?)?;
src/ledger/genesis.rs:284: serde_json::from_slice::<GenesisConstants>(&std::fs::read(all_path)?)?;
src/ledger/staking/mod.rs:187: let bytes = std::fs::read(path)?;
src/ledger/staking/mod.rs:189: .with_context(|| format!("Failed reading staking ledger {}", path.display()))?;
src/ledger/staking/mod.rs:317: let staking_ledger = StakingLedger::parse_file(&path, MAINNET_GENESIS_HASH.into()).await?;
src/ledger/staking/mod.rs:333: let staking_ledger = StakingLedger::parse_file(&path, MAINNET_GENESIS_HASH.into()).await?;
src/ledger/staking/mod.rs:341: } = staking_ledger.aggregate_delegations()?;
src/ledger/staking/parser.rs:24: let ledger_paths: Vec<PathBuf> = glob(&format!("{}/*-*-*.json", ledgers_dir.display()))?
src/ledger/staking/parser.rs:43: if store.get_staking_ledger_hash_by_epoch(epoch)? != Some(hash) {
src/ledger/staking/parser.rs:90: let mut ledger_parser = StakingLedgerParser::new(&ledgers_dir)?;
src/ledger/staking/parser.rs:102: while let Some(staking_ledger) = ledger_parser.next_ledger(None).await? {
src/ledger/public_key.rs:30: let res = String::from_utf8(bytes.to_vec())?;
src/ledger/public_key.rs:132: PublicKey::from_bytes(&bytes)?,
src/mina_blocks/v1/precomputed_block.rs:26: let contents = std::fs::read(path)?;
src/mina_blocks/v1/precomputed_block.rs:27: Ok(serde_json::from_slice(&contents)?)
src/mina_blocks/v1/precomputed_block.rs:39: let block = parse_file(path)?;
src/mina_blocks/v1/precomputed_block.rs:40: println!("{}", serde_json::to_string_pretty(&block)?);
src/mina_blocks/v1/precomputed_block.rs:41: println!("Elapsed time: {:?}", now.elapsed());
src/mina_blocks/v2/precomputed_block.rs:35: let contents = std::fs::read(path)?;
src/mina_blocks/v2/precomputed_block.rs:36: Ok(serde_json::from_slice(&contents)?)
src/mina_blocks/v2/precomputed_block.rs:48: let block = parse_file(path)?;
src/mina_blocks/v2/precomputed_block.rs:50: println!("Elapsed time: {:?}", now.elapsed());
src/mina_blocks/v2/precomputed_block.rs:51: println!("{}", serde_json::to_string_pretty(&block)?);
src/mina_blocks/v2/precomputed_block.rs:58: glob::glob("./tests/data/berkeley/sequential_blocks/berkeley-*-*.json")?.for_each(|path| {
src/mina_blocks/v2/precomputed_block.rs:70: glob::glob("./tests/data/berkeley/non_sequential_blocks/berkeley-*-*.json")?.for_each(
src/mina_blocks/common.rs:11: String::deserialize(de)?
src/mina_blocks/common.rs:22: Ok(<Option<String>>::deserialize(de)?.and_then(|x| x.parse().ok()))
src/mina_blocks/common.rs:31: Ok(<Vec<String>>::deserialize(de)?
src/mina_blocks/common.rs:41: match String::deserialize(de)?.parse::<Decimal>() {
src/proof_systems/signer/pubkey.rs:87: .map_err(|_| PubKeyError::XCoordinateBytes)?;
src/proof_systems/signer/pubkey.rs:89: .map_err(|_| PubKeyError::YCoordinateBytes)?;
src/proof_systems/signer/pubkey.rs:90: let pt = CurvePoint::get_point_from_x(x, y.0.is_odd()).ok_or(PubKeyError::XCoordinate)?;
src/proof_systems/signer/pubkey.rs:110: let bytes: Vec<u8> = hex::decode(public_hex).map_err(|_| PubKeyError::Hex)?;
src/proof_systems/signer/pubkey.rs:140: .map_err(|_| PubKeyError::AddressBase58)?;
src/proof_systems/signer/pubkey.rs:161: let x = BaseField::from_bytes(x_bytes).map_err(|_| PubKeyError::XCoordinateBytes)?;
src/proof_systems/signer/pubkey.rs:162: let mut pt = CurvePoint::get_point_from_x(x, y_parity).ok_or(PubKeyError::XCoordinate)?;
src/proof_systems/signer/pubkey.rs:257: .map_err(|_| PubKeyError::XCoordinateBytes)?;
src/proof_systems/signer/pubkey.rs:269: let public = CurvePoint::get_point_from_x(x, is_odd).ok_or(PubKeyError::XCoordinate)?;
src/proof_systems/signer/pubkey.rs:284: let bytes: Vec<u8> = hex::decode(public_hex).map_err(|_| PubKeyError::Hex)?;
src/proof_systems/signer/pubkey.rs:307: Ok(PubKey::from_address(address)?.into_compressed())
src/proof_systems/signer/seckey.rs:72: ScalarField::from_bytes(&sec_bytes).map_err(|_| SecKeyError::SecretKeyBytes)?;
src/proof_systems/signer/seckey.rs:82: let bytes: Vec<u8> = hex::decode(secret_hex).map_err(|_| SecKeyError::SecretKeyHex)?;
src/proof_systems/signer/seckey.rs:98: .map_err(|_| SecKeyError::SecretKeyBase58)?;
src/proof_systems/mod.rs:80: let bytes: Vec<u8> = hex::decode(hex).map_err(|_| FieldHelpersError::DecodeHex)?;
src/protocol/bin_prot/read_ext.rs:17: match self.read_u8()? {
src/protocol/bin_prot/read_ext.rs:29: match self.read_u8()? {
src/protocol/bin_prot/read_ext.rs:42: Ok(self.read_u8()? as char)
src/protocol/bin_prot/read_ext.rs:48: self.read_exact(&mut buf)?;
src/protocol/bin_prot/read_ext.rs:55: T::from_i16(self.read_i16::<LittleEndian>()?)
src/protocol/bin_prot/read_ext.rs:59: T::from_i32(self.read_i32::<LittleEndian>()?)
src/protocol/bin_prot/read_ext.rs:63: T::from_i64(self.read_i64::<LittleEndian>()?)
src/protocol/bin_prot/read_ext.rs:67: T::from_i8(self.read_i8()?)
src/protocol/bin_prot/read_ext.rs:83: self.read_exact(&mut buf)?;
src/protocol/bin_prot/read_ext.rs:88: T::from_u16(self.read_u16::<LittleEndian>()?)
src/protocol/bin_prot/read_ext.rs:92: T::from_u32(self.read_u32::<LittleEndian>()?)
src/protocol/bin_prot/read_ext.rs:96: T::from_u64(self.read_u64::<LittleEndian>()?)
src/protocol/bin_prot/read_ext.rs:118: self.read_exact(&mut buf)?;
src/protocol/bin_prot/read_ext.rs:124: let len = self.bin_read_nat0::<u64>()? as usize;
src/protocol/bin_prot/read_ext.rs:126: self.read_exact(&mut buf)?;
src/protocol/bin_prot/read_ext.rs:128: .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?;
src/protocol/bin_prot/read_ext.rs:134: let len = self.bin_read_nat0::<u64>()? as usize;
src/protocol/bin_prot/read_ext.rs:136: self.read_exact(&mut buf)?;
src/protocol/bin_prot/read_ext.rs:143:impl<W: io::Read + ?Sized> ReadBinProtExt for W {}
src/protocol/bin_prot/error.rs:34: "Invalid byte for deserializing a {dtype}. Expected one of: {allowed:?}, found: {byte}"
src/protocol/bin_prot/error.rs:46: #[error("Invalid byte sequence when attempting to deserialize utf-8 char: {bytes:?}")]
src/protocol/bin_prot/value/layout/traverse.rs:137: println!("{:?}\n", v);
src/protocol/bin_prot/value/layout/mod.rs:111: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:114: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:117: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:119: "Sum" => Ok(BinProtRule::Sum(from_value(v).map_err(|e| e.to_string())?)),
src/protocol/bin_prot/value/layout/mod.rs:121: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:123: "List" => Ok(BinProtRule::List(from_value(v).map_err(|e| e.to_string())?)),
src/protocol/bin_prot/value/layout/mod.rs:125: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:128: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:131: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:134: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:137: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:143: from_value(v1).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:144: from_value(v2).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:147: from_value(v1).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:148: from_value(v2).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:151: from_value(v1).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:152: from_value(v2).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:207: "Tagged" => Ok(Polyvar::Tagged(from_value(v).map_err(|e| e.to_string())?)),
src/protocol/bin_prot/value/layout/mod.rs:209: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:232: layout_id: String, // what is longident?
src/protocol/bin_prot/value/layout/mod.rs:253: from_value(v).map_err(|e| e.to_string())?,
src/protocol/bin_prot/value/layout/mod.rs:255: "Resolved" => Ok(RuleRef::Resolved(from_value(v).map_err(|e| e.to_string())?)),
src/protocol/bin_prot/value/index.rs:50: T: ?Sized + Index,
src/protocol/bin_prot/value/ser.rs:35: let mut map = serializer.serialize_struct("", m.len())?;
src/protocol/bin_prot/value/ser.rs:37: map.serialize_field("", v)?;
src/protocol/bin_prot/value/ser.rs:42: let mut t = serializer.serialize_tuple(vals.len())?;
src/protocol/bin_prot/value/ser.rs:44: t.serialize_element(v)?;
src/protocol/bin_prot/value/mod.rs:91: panic!("Called inner on a non-option variant {:?}", self)
src/protocol/bin_prot/value/visitor.rs:71: )?))))
src/protocol/bin_prot/value/visitor.rs:85: while let Some(elem) = visitor.next_element()? {
src/protocol/bin_prot/value/visitor.rs:101: while let Some((k, v)) = visitor.next_entry()? {
src/protocol/bin_prot/value/visitor.rs:112: let (payload, variant_access) = data.variant::<EnumData>()?;
src/protocol/bin_prot/value/visitor.rs:119: let body = variant_access.tuple_variant(len, self)?;
src/protocol/bin_prot/value/visitor.rs:132: let body = variant_access.tuple_variant(len, self)?;
src/protocol/bin_prot/ser.rs:30: self.writer.write_all(buf)?;
src/protocol/bin_prot/ser.rs:48: .bin_write_polyvar_tag(caml_hash_variant(variant))?;
src/protocol/bin_prot/ser.rs:51: self.writer.bin_write_variant_index(b)?;
src/protocol/bin_prot/ser.rs:54: self.writer.bin_write_polyvar_tag(index)?;
src/protocol/bin_prot/ser.rs:101: self.writer.bin_write_bool(v)?;
src/protocol/bin_prot/ser.rs:107: self.writer.bin_write_integer(v)?;
src/protocol/bin_prot/ser.rs:112: self.writer.bin_write_integer(v)?;
src/protocol/bin_prot/ser.rs:117: self.writer.bin_write_integer(v)?;
src/protocol/bin_prot/ser.rs:122: self.writer.bin_write_integer(v)?;
src/protocol/bin_prot/ser.rs:127: self.write_byte(v)?;
src/protocol/bin_prot/ser.rs:132: self.writer.bin_write_integer(v)?;
src/protocol/bin_prot/ser.rs:137: self.writer.bin_write_integer(v)?;
src/protocol/bin_prot/ser.rs:148: self.writer.bin_write_integer(v as i64)?;
src/protocol/bin_prot/ser.rs:153: self.writer.bin_write_float32(&v)?;
src/protocol/bin_prot/ser.rs:158: self.writer.bin_write_float64(&v)?;
src/protocol/bin_prot/ser.rs:170: // First the length of the string is written as a Nat0 (in characters?)
src/protocol/bin_prot/ser.rs:173: self.writer.bin_write_nat0(v.len() as u64)?;
src/protocol/bin_prot/ser.rs:186: self.writer.bin_write_unit()?;
src/protocol/bin_prot/ser.rs:194: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:196: self.write_byte(0x01)?;
src/protocol/bin_prot/ser.rs:203: self.writer.bin_write_unit()?;
src/protocol/bin_prot/ser.rs:235: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:249: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:251: self.write_variant_index_or_tag(name, variant, variant_index)?;
src/protocol/bin_prot/ser.rs:263: self.writer.bin_write_nat0(len as u64)?;
src/protocol/bin_prot/ser.rs:294: self.write_variant_index_or_tag(name, variant, variant_index)?;
src/protocol/bin_prot/ser.rs:316: self.write_variant_index_or_tag(name, variant, variant_index)?;
src/protocol/bin_prot/ser.rs:338: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:358: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:378: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:405: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:412: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:434: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:453: T: ?Sized + Serialize,
src/protocol/bin_prot/ser.rs:472: T: ?Sized + Serialize,
src/protocol/bin_prot/de.rs:65: let value = Deserialize::deserialize(&mut de)?;
src/protocol/bin_prot/de.rs:74: let value = Deserialize::deserialize(&mut de)?;
src/protocol/bin_prot/de.rs:115: visitor.visit_bool(self.rdr.bin_read_bool()?)
src/protocol/bin_prot/de.rs:125: visitor.visit_i8(self.rdr.bin_read_integer()?)
src/protocol/bin_prot/de.rs:132: visitor.visit_i16(self.rdr.bin_read_integer()?)
src/protocol/bin_prot/de.rs:139: visitor.visit_i32(self.rdr.bin_read_integer()?)
src/protocol/bin_prot/de.rs:146: visitor.visit_i64(self.rdr.bin_read_integer()?)
src/protocol/bin_prot/de.rs:153: visitor.visit_u8(self.rdr.read_u8()?)
src/protocol/bin_prot/de.rs:160: visitor.visit_u16(self.rdr.bin_read_integer()?)
src/protocol/bin_prot/de.rs:167: visitor.visit_u32(self.rdr.bin_read_integer()?)
src/protocol/bin_prot/de.rs:174: visitor.visit_u64(self.rdr.bin_read_integer()?)
src/protocol/bin_prot/de.rs:181: visitor.visit_f32(self.rdr.read_f32::<LittleEndian>()?)
src/protocol/bin_prot/de.rs:188: visitor.visit_f64(self.rdr.read_f64::<LittleEndian>()?)
src/protocol/bin_prot/de.rs:195: visitor.visit_char(self.rdr.bin_read_char()?)
src/protocol/bin_prot/de.rs:209: visitor.visit_string(self.rdr.bin_read_string()?)
src/protocol/bin_prot/de.rs:232: match self.rdr.bin_read_bool()? {
src/protocol/bin_prot/de.rs:243: self.rdr.bin_read_unit()?;
src/protocol/bin_prot/de.rs:271: let len = self.rdr.bin_read_nat0()?;
src/protocol/bin_prot/de.rs:306: let len: usize = self.rdr.bin_read_nat0()?;
src/protocol/bin_prot/de.rs:337: let hash = self.rdr.bin_read_polyvar_tag()?;
src/protocol/bin_prot/de.rs:341: let index = self.rdr.bin_read_variant_index()?;
src/protocol/bin_prot/de.rs:414: .ok_or(Error::UnknownPolyvarTag(self.hash))?;
src/protocol/bin_prot/de.rs:416: let v = seed.deserialize(de)?;
src/protocol/bin_prot/de.rs:449: let v = seed.deserialize(de)?;
src/protocol/bin_prot/write_ext.rs:25: self.write_u8(c as u8)?;
src/protocol/bin_prot/write_ext.rs:37: self.write_u8(CODE_INT16)?;
src/protocol/bin_prot/write_ext.rs:41: self.write_u8(CODE_INT32)?;
src/protocol/bin_prot/write_ext.rs:45: self.write_u8(CODE_INT64)?;
src/protocol/bin_prot/write_ext.rs:53: self.write_u8(CODE_NEG_INT8)?;
src/protocol/bin_prot/write_ext.rs:57: self.write_u8(CODE_INT16)?;
src/protocol/bin_prot/write_ext.rs:61: self.write_u8(CODE_INT32)?;
src/protocol/bin_prot/write_ext.rs:65: self.write_u8(CODE_INT64)?;
src/protocol/bin_prot/write_ext.rs:85: self.write_u8(CODE_INT16)?;
src/protocol/bin_prot/write_ext.rs:89: self.write_u8(CODE_INT32)?;
src/protocol/bin_prot/write_ext.rs:93: self.write_u8(CODE_INT64)?;
src/protocol/bin_prot/write_ext.rs:133:impl<W: io::Write + ?Sized> WriteBinProtExt for W {}
src/protocol/bin_prot/loose_deserializer.rs:26: self.rdr.bin_read_unit()?;
src/protocol/bin_prot/loose_deserializer.rs:39: BinProtRule::Bool => visitor.visit_bool(self.rdr.bin_read_bool()?),
src/protocol/bin_prot/loose_deserializer.rs:44: let index = self.rdr.bin_read_variant_index()?;
src/protocol/bin_prot/loose_deserializer.rs:55: let tag = self.rdr.bin_read_polyvar_tag()?;
src/protocol/bin_prot/loose_deserializer.rs:74: .ok_or(Error::UnknownPolyvarTag(tag))?;
src/protocol/bin_prot/loose_deserializer.rs:84: let index = self.rdr.bin_read_variant_index()?; // 0 or 1
src/protocol/bin_prot/loose_deserializer.rs:94: BinProtRule::String => visitor.visit_bytes(&self.rdr.bin_read_bytes()?),
src/protocol/bin_prot/loose_deserializer.rs:95: BinProtRule::Float => visitor.visit_f64(self.rdr.read_f64::<LittleEndian>()?),
src/protocol/bin_prot/loose_deserializer.rs:97: let c = self.rdr.read_u8()?;
src/protocol/bin_prot/loose_deserializer.rs:102: let len = self.rdr.bin_read_nat0()?;
src/protocol/bin_prot/loose_deserializer.rs:112: | BinProtRule::NativeInt => visitor.visit_i64(self.rdr.bin_read_integer()?),
src/protocol/bin_prot/loose_deserializer.rs:243: let v = seed.deserialize(&mut de)?;
src/protocol/serialization_types/consensus_state.rs:45: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/consensus_state.rs:49: .map_err(<D::Error as serde::de::Error>::custom)?,
src/protocol/serialization_types/consensus_state.rs:79: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/consensus_state.rs:83: .map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/field_and_curve_elements.rs:144: let bytes = hex::decode(s)?;
src/protocol/serialization_types/field_and_curve_elements.rs:166: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/protocol_state_proof.rs:66: .map_err(<S::Error as serde::ser::Error>::custom)?;
src/protocol/serialization_types/protocol_state_proof.rs:77: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/protocol_state_proof.rs:80: .map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/protocol_state_proof.rs:82: .map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/signatures.rs:62: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/signatures.rs:64: CompressedPubKey::from_address(&s).map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/signatures.rs:92: bin_prot::to_writer(&mut buf, &self.0).map_err(<S::Error as serde::ser::Error>::custom)?;
src/protocol/serialization_types/signatures.rs:105: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/signatures.rs:109: .map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/signatures.rs:112: .map_err(<D::Error as serde::de::Error>::custom)?,
src/protocol/serialization_types/staged_ledger_diff.rs:273: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/staged_ledger_diff.rs:277: .map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/common.rs:59: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/common.rs:62: s.parse().map_err(<D::Error as serde::de::Error>::custom)?,
src/protocol/serialization_types/common.rs:87: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/common.rs:90: s.parse().map_err(<D::Error as serde::de::Error>::custom)?,
src/protocol/serialization_types/common.rs:124: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/common.rs:128: .ok_or_else(|| <D::Error as serde::de::Error>::custom(format!("Invalid string: {s}")))?
src/protocol/serialization_types/common.rs:130: .map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/common.rs:134: .map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/common.rs:217: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/common.rs:251: let s = String::deserialize(deserializer)?;
src/protocol/serialization_types/common.rs:274: .map_err(Base58DecodeError)?;
src/protocol/serialization_types/common.rs:314: .map_err(<S::Error as serde::ser::Error>::custom)?;
src/protocol/serialization_types/common.rs:328: String::deserialize(deserializer).map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/common.rs:346: .map_err(Base58DecodeError)?;
src/protocol/serialization_types/common.rs:348: let data: T = bin_prot::from_reader_strict(&bytes[1..]).map_err(BinProtError)?;
src/protocol/serialization_types/common.rs:359: let builder = self.to_base58_builder()?;
src/protocol/serialization_types/common.rs:368: bin_prot::to_writer(&mut buf, &self.0)?;
src/protocol/serialization_types/common.rs:389: .map_err(<S::Error as serde::ser::Error>::custom)?;
src/protocol/serialization_types/common.rs:404: String::deserialize(deserializer).map_err(<D::Error as serde::de::Error>::custom)?;
src/protocol/serialization_types/common.rs:439:/// Q: why does this work?
src/server.rs:118: start_uds_server(&subsys, state.clone(), &domain_socket_path).await?;
src/server.rs:139: .await?;
src/server.rs:182: error!("Failed to create blocks directory in {blocks_dir:#?}: {e}");
src/server.rs:188: error!("Failed to create staking ledgers directory in {staking_ledgers_dir:#?}: {e}");
src/server.rs:225: IndexerState::new_from_config(state_config)?
src/server.rs:228: info!("Replaying indexer events from db at {db_path:#?}");
src/server.rs:229: IndexerState::new_without_genesis_events(state_config)?
src/server.rs:232: info!("Syncing indexer state from db at {db_path:#?}");
src/server.rs:233: IndexerState::new_without_genesis_events(state_config)?
src/server.rs:243: error!("Failed to ingest staking ledger {staking_ledgers_dir:#?}: {e}");
src/server.rs:261: .await?;
src/server.rs:279: let min_length_filter = state.replay_events(replay_state)?;
src/server.rs:285: )?;
src/server.rs:288: info!("Adding new blocks from {blocks_dir:#?}");
src/server.rs:289: state.add_blocks(&mut block_parser).await?;
src/server.rs:295: let min_length_filter = state.sync_from_db()?;
src/server.rs:301: )?;
src/server.rs:304: info!("Adding new blocks from {blocks_dir:#?}");
src/server.rs:305: state.add_blocks(&mut block_parser).await?;
src/server.rs:314: Checkpoint::new(&store.database)?.create_checkpoint(&temp_checkpoint_dir)?;
src/server.rs:315: fs::remove_dir_all(&temp_checkpoint_dir)?;
src/server.rs:382: )?;
src/server.rs:385: watcher.watch(blocks_dir.as_ref(), RecursiveMode::NonRecursive)?;
src/server.rs:387: "Watching for precomputed blocks in directory: {:#?}",
src/server.rs:393: watcher.watch(staking_ledgers_dir.as_ref(), RecursiveMode::NonRecursive)?;
src/server.rs:395: "Watching for staking ledgers in directory: {:#?}",
src/server.rs:415: Ok(event) => process_event(event, &state).await?,
src/server.rs:454: trace!("Event: {event:?}");
src/server.rs:487: match state.block_pipeline(&block, path.metadata()?.len()) {
src/server.rs:499: version.version.update()?;
src/server.rs:566: "Error fetching new blocks: {e}, pgm: {}, args: {:?}",
src/server.rs:608: "Error recovery missing block: {e}, pgm: {}, args: {:?}",
src/server.rs:657: "Initializing database from blocks in {blocks_dir:#?} and staking ledgers in {staking_ledgers_dir:#?}"
src/server.rs:660: "Initializing database from blocks in {blocks_dir:#?}"
src/server.rs:663: "Initializing database from staking ledgers in {staking_ledgers_dir:#?}"
src/snark_work/mod.rs:187: let contents = std::fs::read(path.clone())?;
src/snark_work/mod.rs:188: let block = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/snark_work/mod.rs:190: if let Value::Array(arr) = from_slice::<Value>(&contents)?["staged_ledger_diff"]["diff"][0]
src/snark_work/mod.rs:223: let contents = std::fs::read(path.clone())?;
src/snark_work/mod.rs:225: let block = PrecomputedBlock::parse_file(&path, PcbVersion::V1)?;
src/snark_work/mod.rs:227: if let Value::Array(arr) = from_str::<Value>(&contents)?["staged_ledger_diff"]["diff"][1]
src/state/branch.rs:27: let root = branches.insert(Node::new(root_block), AsRoot)?;
src/state/branch.rs:41: VrfOutput::base64_decode(MAINNET_GENESIS_LAST_VRF_OUTPUT)?.hex_digest(),
src/state/branch.rs:45: let root = branches.insert(Node::new(genesis_block), AsRoot)?;
src/state/branch.rs:418: self.branches.write_formatted(&mut tree)?;
src/state/mod.rs:206: .set_chain_id_for_network(&config.version.chain_id, &config.version.network)?;
src/state/mod.rs:208: let genesis_block = GenesisBlock::new()?;
src/state/mod.rs:216: )?;
src/state/mod.rs:221: .add_block(&genesis_block, genesis_bytes)?;
src/state/mod.rs:231: )?;
src/state/mod.rs:236: .set_best_block(&genesis_block.state_hash())?;
src/state/mod.rs:242: )?;
src/state/mod.rs:249: .apply_diff_from_precomputed(&genesis_block)?,
src/state/mod.rs:277: Branch::new_genesis(config.genesis_hash, MAINNET_GENESIS_PREV_STATE_HASH.into())?;
src/state/mod.rs:393: block_parser.next_block().await?
src/state/mod.rs:402: indexer_store.add_block(&block, block_bytes)?;
src/state/mod.rs:403: indexer_store.set_best_block(&block.state_hash())?;
src/state/mod.rs:410: )?;
src/state/mod.rs:414: self.ledger._apply_diff(&ledger_diff)?;
src/state/mod.rs:416: indexer_store.add_ledger_state_hash(&state_hash, self.ledger.clone())?;
src/state/mod.rs:421: self.root_branch = Branch::new(&block)?;
src/state/mod.rs:422: self.ledger._apply_diff(&ledger_diff)?;
src/state/mod.rs:482: self.report_progress(block_parser, step_time, total_time)?;
src/state/mod.rs:488: self.block_pipeline(&block, block_bytes)?;
src/state/mod.rs:492: self.add_block_to_store(&block, block_bytes, true)?;
src/state/mod.rs:498: "Ingested and applied {} blocks ({}) to the witness tree in {:?}",
src/state/mod.rs:528: if let Some(db_event) = self.add_block_to_store(block, block_bytes, false)? {
src/state/mod.rs:531: if let Some(wt_event) = self.add_block_to_witness_tree(block, true)?.1 {
src/state/mod.rs:542: debug!("Block not added: {db_event:?}");
src/state/mod.rs:546: if let Some(username_updates) = self.update_best_block_in_store(&best_tip.state_hash)? {
src/state/mod.rs:588: if let Some(root_extension) = self.root_extension(precomputed_block)? {
src/state/mod.rs:598: canonical_blocks: self.prune_root_branch()?,
src/state/mod.rs:607: self.dangling_extension(precomputed_block)?
src/state/mod.rs:769: self.dangling_branches.push(Branch::new(precomputed_block)?);
src/state/mod.rs:797: let canonical_event = self.update_canonical()?;
src/state/mod.rs:832: let new_canonical_blocks = self.get_new_canonical_blocks(&old_canonical_root_id)?;
src/state/mod.rs:834: self.update_ledger(&new_canonical_blocks)?;
src/state/mod.rs:835: self.update_ledger_store(&new_canonical_blocks)?;
src/state/mod.rs:836: self.prune_diffs_map(&old_canonical_root_id)?;
src/state/mod.rs:885: best_ledger._apply_diff(diff)?;
src/state/mod.rs:897: return Ok(indexer_store.get_block(&state_hash)?.map(|b| b.0));
src/state/mod.rs:930: let mut ledger_parser = StakingLedgerParser::new(ledgers_dir)?;
src/state/mod.rs:948: .add_staking_ledger(staking_ledger, &self.version.genesis_state_hash)?;
src/state/mod.rs:995: )?;
src/state/mod.rs:1005: indexer_store.set_best_block(state_hash)?;
src/state/mod.rs:1022: let next_seq_num = indexer_store.get_next_seq_num()?;
src/state/mod.rs:1023: let best_block_height = indexer_store.get_best_block_height()?.unwrap_or_default();
src/state/mod.rs:1049: if let Some((root_block, _)) = indexer_store.get_block(state_hash)? {
src/state/mod.rs:1050: self.root_branch = Branch::new(&root_block)?;
src/state/mod.rs:1121: self.blocks_processed = indexer_store.get_block_production_total_count()?;
src/state/mod.rs:1124: .get(IndexerStore::NUM_BLOCK_BYTES_PROCESSED)?
src/state/mod.rs:1134: self.add_block_to_witness_tree(&block, false)?;
src/state/mod.rs:1178: if let Some((block, _)) = indexer_store.get_block(state_hash)? {
src/state/mod.rs:1182: indexer_store.get_block_height(state_hash)?,
src/state/mod.rs:1202: indexer_store.get_block_height(state_hash)?,
src/state/mod.rs:1205: self.add_block_to_witness_tree(&block, true)?;
src/state/mod.rs:1221: if let Some(_ledger) = indexer_store.get_ledger_state_hash(state_hash, false)? {
src/state/mod.rs:1222: if let Some((block, _)) = indexer_store.get_block(state_hash)? {
src/state/mod.rs:1248: .get_delegations_epoch(*epoch, &Some(genesis_state_hash.to_owned()))?
src/state/mod.rs:1253: )? {
src/state/mod.rs:1257: staking_ledger.aggregate_delegations()?
src/state/mod.rs:1275: indexer_store.get_canonical_hash_at_height(*blockchain_length)?
src/state/mod.rs:1278: if let Some((block, _)) = indexer_store.get_block(state_hash)? {
src/state/mod.rs:1282: indexer_store.get_block_height(state_hash)?,
src/state/mod.rs:1303: indexer_store.get_staking_ledger_at_epoch(*epoch, None)?
src/state/mod.rs:1314: )? {
src/state/mod.rs:1392: .add_ledger_state_hash(&canonical_block.state_hash, self.ledger.clone())?;
src/state/mod.rs:1528: "{}/{} blocks ({:?}/{:?}) parsed and applied in {:?}",
src/state/mod.rs:1547: info!("Estimate rem time: {dur:?}");
src/state/mod.rs:1570: "Parsed and added {} blocks of {} ({:?} of {:?}) to the witness tree in {:?}",
src/state/mod.rs:1591: info!("Estimate rem time: {dur:?}");
src/state/mod.rs:1605: writeln!(f, "=== Root branch ===")?;
src/state/mod.rs:1606: writeln!(f, "{}", self.root_branch)?;
src/state/mod.rs:1609: writeln!(f, "=== Dangling branches ===")?;
src/state/mod.rs:1611: writeln!(f, "Dangling branch {n}:")?;
src/state/mod.rs:1612: writeln!(f, "{branch}")?;
src/state/summary.rs:95: summary_short(self, f)?;
src/state/summary.rs:96: writeln!(f, "\n===== Witness tree =====")?;
src/state/summary.rs:97: write!(f, "{}", self.witness_tree.witness_tree)?;
src/state/summary.rs:134: writeln!(f, "===== Mina-indexer summary =====")?;
src/state/summary.rs:135: writeln!(f, " Uptime: {:?}", state.uptime())?;
src/state/summary.rs:136: writeln!(f, " Blocks added: {}", state.blocks_processed())?;
src/state/summary.rs:145: )?;
src/state/summary.rs:146: writeln!(f, " Max staking ledger hash: {}", max_staking_ledger_hash)?;
src/state/summary.rs:149: writeln!(f, "\n=== Root branch ===")?;
src/state/summary.rs:150: writeln!(f, " Height: {}", state.root_height())?;
src/state/summary.rs:151: writeln!(f, " Length: {}", state.root_length())?;
src/state/summary.rs:152: writeln!(f, " Num leaves: {}", state.num_leaves())?;
src/state/summary.rs:153: writeln!(f, " Root hash: {}", state.root_hash())?;
src/state/summary.rs:154: writeln!(f, " Best tip length: {}", state.best_tip_length())?;
src/state/summary.rs:155: writeln!(f, " Best tip hash: {}", state.best_tip_hash())?;
src/state/summary.rs:158: writeln!(f, "\n=== Dangling branches ===")?;
src/state/summary.rs:159: writeln!(f, " Num: {}", state.num_dangling())?;
src/state/summary.rs:160: writeln!(f, " Max height: {}", state.max_dangling_length())?;
src/state/summary.rs:161: writeln!(f, " Max length: {}", state.max_dangling_height())?;
src/state/summary.rs:165: writeln!(f, "\n=== DB stats ===")?;
src/state/summary.rs:170: )?;
src/state/summary.rs:171: writeln!(f, " Uptime: {}", state.db_stats().uptime)?;
src/state/summary.rs:172: writeln!(f, " Cumulative writes: {}", state.db_stats().cum_writes)?;
src/state/summary.rs:173: writeln!(f, " Cumulative WAL: {}", state.db_stats().cum_wal)?;
src/state/summary.rs:174: writeln!(f, " Cumulative stall: {}", state.db_stats().cum_stall)?;
src/state/summary.rs:175: writeln!(f, " Interval writes: {}", state.db_stats().int_writes)?;
src/state/summary.rs:176: writeln!(f, " Interval WAL: {}", state.db_stats().int_wal)?;
src/state/summary.rs:177: writeln!(f, " Interval stall: {}", state.db_stats().int_stall)?;
src/state/summary.rs:319: let memory = lines.next().unwrap().parse::<u64>()?;
src/store/version_store_impl.rs:22: trace!("Setting database version: {version:#?}");
src/store/version_store_impl.rs:25: .get(Self::INDEXER_STORE_VERSION_KEY)?
src/store/version_store_impl.rs:30: serde_json::to_vec(&version)?,
src/store/version_store_impl.rs:31: )?;
src/store/version_store_impl.rs:41: .get(Self::INDEXER_STORE_VERSION_KEY)?
src/store/ledger_store_impl.rs:28: .get_cf(self.ledgers_cf(), ledger_hash.0.as_bytes())?
src/store/ledger_store_impl.rs:34: )?;
src/store/ledger_store_impl.rs:40: self.get_ledger_state_hash(&self.get_best_block_hash()?.expect("best block"), true)
src/store/ledger_store_impl.rs:51: )?;
src/store/ledger_store_impl.rs:55: .get_known_genesis_prev_state_hashes()?
src/store/ledger_store_impl.rs:68: )))?;
src/store/ledger_store_impl.rs:71: match self.get_block(state_hash)? {
src/store/ledger_store_impl.rs:81: )))?;
src/store/ledger_store_impl.rs:101: self.update_account_balance(pk, Some(acct.balance.0))?;
src/store/ledger_store_impl.rs:105: self.add_ledger_state_hash(state_hash, genesis_ledger)?;
src/store/ledger_store_impl.rs:123: .get_pinned_cf(self.ledgers_cf(), curr_state_hash.0.as_bytes())?
src/store/ledger_store_impl.rs:127: if let Some(diff) = self.get_block_ledger_diff(&curr_state_hash)? {
src/store/ledger_store_impl.rs:144: .get_pinned_cf(self.ledgers_cf(), curr_state_hash.0.as_bytes())?
src/store/ledger_store_impl.rs:150: ledger._apply_diff(&diff)?;
src/store/ledger_store_impl.rs:154: self.add_ledger_state_hash(state_hash, ledger.clone())?;
src/store/ledger_store_impl.rs:166: .get_pinned_cf(self.ledgers_cf(), key)?
src/store/ledger_store_impl.rs:171: .get_pinned_cf(self.ledgers_cf(), state_hash.0.as_bytes())?
src/store/ledger_store_impl.rs:182: self.get_canonical_hash_at_height(height)?
src/store/ledger_store_impl.rs:193: trace!("Setting block ledger diff {state_hash}: {ledger_diff:?}");
src/store/ledger_store_impl.rs:197: serde_json::to_vec(&ledger_diff)?,
src/store/ledger_store_impl.rs:198: )?)
src/store/ledger_store_impl.rs:205: .get_pinned_cf(self.block_ledger_diff_cf(), state_hash.0.as_bytes())?
src/store/ledger_store_impl.rs:219: )?)
src/store/ledger_store_impl.rs:229: .get_cf(self.block_staged_ledger_hash_cf(), state_hash.0.as_bytes())?
src/store/ledger_store_impl.rs:246: if let Some(ledger_hash) = self.get_staking_ledger_hash_by_epoch(epoch)? {
src/store/ledger_store_impl.rs:252: )?
src/store/ledger_store_impl.rs:281: return Ok(Some(serde_json::from_slice(&bytes)?));
src/store/ledger_store_impl.rs:315: .get_pinned_cf(self.staking_ledgers_cf(), key.clone())?
src/store/ledger_store_impl.rs:322: serde_json::to_vec(&staking_ledger)?,
src/store/ledger_store_impl.rs:323: )?;
src/store/ledger_store_impl.rs:326: self.set_ledger_hash_epoch_pair(&staking_ledger.ledger_hash, epoch)?;
src/store/ledger_store_impl.rs:329: self.set_ledger_hash_genesis_pair(&staking_ledger.ledger_hash, genesis_state_hash)?;
src/store/ledger_store_impl.rs:333: let aggregated_delegations = staking_ledger.aggregate_delegations()?;
src/store/ledger_store_impl.rs:337: serde_json::to_vec(&aggregated_delegations)?,
src/store/ledger_store_impl.rs:338: )?;
src/store/ledger_store_impl.rs:346: serde_json::to_vec(account)?,
src/store/ledger_store_impl.rs:347: )?;
src/store/ledger_store_impl.rs:360: serde_json::to_vec(account)?,
src/store/ledger_store_impl.rs:361: )?;
src/store/ledger_store_impl.rs:369: )?;
src/store/ledger_store_impl.rs:378: )))?;
src/store/ledger_store_impl.rs:386: )))?;
src/store/ledger_store_impl.rs:404: )? {
src/store/ledger_store_impl.rs:405: return Ok(Some(serde_json::from_slice(&bytes)?));
src/store/ledger_store_impl.rs:417: )?
src/store/ledger_store_impl.rs:425: .get_cf(self.staking_ledger_epoch_to_hash_cf(), to_be_bytes(epoch))?
src/store/ledger_store_impl.rs:439: )?;
src/store/ledger_store_impl.rs:444: )?)
src/store/ledger_store_impl.rs:457: )?)
src/store/ledger_store_impl.rs:470: )?
src/store/ledger_store_impl.rs:504: trace!("Getting staking ledger accounts count for epoch {epoch} {genesis_state_hash:?}");
src/store/ledger_store_impl.rs:510: )?
src/store/ledger_store_impl.rs:520: trace!("Setting staking ledger accounts count for epoch {epoch} {genesis_state_hash:?}: {count}");
src/store/ledger_store_impl.rs:525: )?)
src/store/canonicity_store_impl.rs:33: )?;
src/store/canonicity_store_impl.rs:40: )?;
src/store/canonicity_store_impl.rs:43: if let Some(completed_works) = self.get_snark_work_in_block(state_hash)? {
src/store/canonicity_store_impl.rs:44: self.update_top_snarkers(completed_works)?;
src/store/canonicity_store_impl.rs:50: self.get_known_genesis_state_hashes()?,
src/store/canonicity_store_impl.rs:51: self.get_known_genesis_prev_state_hashes()?,
src/store/canonicity_store_impl.rs:61: serde_json::to_vec(&genesis_state_hashes)?,
src/store/canonicity_store_impl.rs:62: )?;
src/store/canonicity_store_impl.rs:68: serde_json::to_vec(&genesis_prev_state_hashes)?,
src/store/canonicity_store_impl.rs:69: )?;
src/store/canonicity_store_impl.rs:79: )))?;
src/store/canonicity_store_impl.rs:87: .get_pinned(Self::KNOWN_GENESIS_STATE_HASHES_KEY)?
src/store/canonicity_store_impl.rs:97: .get_pinned(Self::KNOWN_GENESIS_PREV_STATE_HASHES_KEY)?
src/store/canonicity_store_impl.rs:107: .get_pinned_cf(&self.canonicity_length_cf(), to_be_bytes(height))?
src/store/canonicity_store_impl.rs:115: .get_pinned_cf(&self.canonicity_slot_cf(), to_be_bytes(global_slot))?
src/store/canonicity_store_impl.rs:123: .get_canonical_hash_at_height(height)?
src/store/canonicity_store_impl.rs:150: let a_length = self.get_block_height(&a)?.expect("a has a length");
src/store/canonicity_store_impl.rs:151: let b_length = self.get_block_height(&b)?.expect("b has a length");
src/store/canonicity_store_impl.rs:164: .get_block_global_slot(&b)?
src/store/canonicity_store_impl.rs:168: b = self.get_block_parent_hash(&b)?.expect("b has a parent");
src/store/canonicity_store_impl.rs:172: let mut a_prev = self.get_block_parent_hash(&a)?.expect("a has a parent");
src/store/canonicity_store_impl.rs:173: let mut b_prev = self.get_block_parent_hash(&b)?.expect("b has a parent");
src/store/canonicity_store_impl.rs:179: blockchain_length: self.get_block_height(&a)?.unwrap(),
src/store/canonicity_store_impl.rs:180: global_slot: self.get_block_global_slot(&a)?.unwrap(),
src/store/canonicity_store_impl.rs:184: blockchain_length: self.get_block_height(&b)?.unwrap(),
src/store/canonicity_store_impl.rs:185: global_slot: self.get_block_global_slot(&b)?.unwrap(),
src/store/canonicity_store_impl.rs:192: a_prev = self.get_block_parent_hash(&a)?.expect("a has a parent");
src/store/canonicity_store_impl.rs:193: b_prev = self.get_block_parent_hash(&b)?.expect("b has a parent");
src/store/canonicity_store_impl.rs:199: trace!("Updating block canonicities: {updates:?}");
src/store/canonicity_store_impl.rs:206: )?;
src/store/canonicity_store_impl.rs:208: .delete_cf(self.canonicity_slot_cf(), to_be_bytes(unapply.global_slot))?;
src/store/canonicity_store_impl.rs:218: )?;
src/store/canonicity_store_impl.rs:223: )?;
src/store/username_store_impl.rs:32: serde_json::to_vec(username_updates)?,
src/store/username_store_impl.rs:33: )?)
src/store/username_store_impl.rs:43: .get_pinned_cf(self.usernames_per_block_cf(), state_hash.0.as_bytes())?
src/store/username_store_impl.rs:62: let a_length = self.get_block_height(&a)?.expect("a has a length");
src/store/username_store_impl.rs:63: let b_length = self.get_block_height(&b)?.expect("b has a length");
src/store/username_store_impl.rs:66: let genesis_state_hashes: Vec<BlockHash> = self.get_known_genesis_state_hashes()?;
src/store/username_store_impl.rs:74: self.get_block_username_updates(&b)?.unwrap(),
src/store/username_store_impl.rs:76: b = self.get_block_parent_hash(&b)?.expect("b has a parent");
src/store/username_store_impl.rs:80: let mut a_prev = self.get_block_parent_hash(&a)?.expect("a has a parent");
src/store/username_store_impl.rs:81: let mut b_prev = self.get_block_parent_hash(&b)?.expect("b has a parent");
src/store/username_store_impl.rs:86: self.get_block_username_updates(&a)?.unwrap(),
src/store/username_store_impl.rs:89: self.get_block_username_updates(&b)?.unwrap(),
src/store/username_store_impl.rs:96: a_prev = self.get_block_parent_hash(&a)?.expect("a has a parent");
src/store/username_store_impl.rs:97: b_prev = self.get_block_parent_hash(&b)?.expect("b has a parent");
src/store/username_store_impl.rs:110: if let Some(num) = self.get_pk_num_username_updates(pk)? {
src/store/username_store_impl.rs:115: .delete_cf(self.username_pk_num_cf(), pk.0.as_bytes())?;
src/store/username_store_impl.rs:120: self.database.delete_cf(self.username_pk_index_cf(), key)?;
src/store/username_store_impl.rs:126: )?;
src/store/username_store_impl.rs:131: self.database.delete_cf(self.username_pk_index_cf(), key)?;
src/store/username_store_impl.rs:141: if let Some(mut num) = self.get_pk_num_username_updates(&pk)? {
src/store/username_store_impl.rs:148: )?;
src/store/username_store_impl.rs:157: )?;
src/store/username_store_impl.rs:163: )?;
src/store/username_store_impl.rs:172: )?;
src/store/username_store_impl.rs:185: .get_cf(self.username_pk_index_cf(), key)?
src/store/username_store_impl.rs:193: .get_cf(self.username_pk_num_cf(), pk.0.as_bytes())?
src/store/block_store_impl.rs:38: value.append(&mut serde_json::to_vec(&block)?);
src/store/block_store_impl.rs:49: .put_cf(self.blocks_cf(), state_hash.0.as_bytes(), value)?;
src/store/block_store_impl.rs:52: self.set_block_ledger_diff(&state_hash, LedgerDiff::from_precomputed(block))?;
src/store/block_store_impl.rs:55: self.set_block_epoch(&state_hash, block.epoch_count())?;
src/store/block_store_impl.rs:58: self.increment_block_production_count(block)?;
src/store/block_store_impl.rs:61: self.set_block_comparison(&state_hash, &BlockComparison::from(block))?;
src/store/block_store_impl.rs:64: self.set_block_height(&state_hash, block.blockchain_length())?;
src/store/block_store_impl.rs:67: self.set_block_global_slot(&state_hash, block.global_slot_since_genesis())?;
src/store/block_store_impl.rs:70: self.set_block_parent_hash(&state_hash, &block.previous_state_hash())?;
src/store/block_store_impl.rs:73: self.set_block_staged_ledger_hash(&state_hash, &block.staged_ledger_hash())?;
src/store/block_store_impl.rs:76: self.set_block_genesis_state_hash(&state_hash, &block.genesis_state_hash())?;
src/store/block_store_impl.rs:82: )?;
src/store/block_store_impl.rs:85: self.set_block_creator(block)?;
src/store/block_store_impl.rs:88: self.set_coinbase_receiver(block)?;
src/store/block_store_impl.rs:94: )?;
src/store/block_store_impl.rs:98: .put_cf(self.blocks_height_sort_cf(), block_height_key(block), b"")?;
src/store/block_store_impl.rs:103: )?;
src/store/block_store_impl.rs:107: self.add_block_at_public_key(&pk, &state_hash)?;
src/store/block_store_impl.rs:111: self.add_block_at_height(&state_hash, block.blockchain_length())?;
src/store/block_store_impl.rs:114: self.add_block_at_slot(&state_hash, block.global_slot_since_genesis())?;
src/store/block_store_impl.rs:117: self.set_block_version(&state_hash, block.version())?;
src/store/block_store_impl.rs:120: self.add_user_commands(block)?;
src/store/block_store_impl.rs:123: self.add_internal_commands(block)?;
src/store/block_store_impl.rs:126: self.add_snark_work(block)?;
src/store/block_store_impl.rs:131: .get(Self::NUM_BLOCK_BYTES_PROCESSED)?
src/store/block_store_impl.rs:136: )?;
src/store/block_store_impl.rs:143: self.add_event(&IndexerEvent::Db(db_event.clone()))?;
src/store/block_store_impl.rs:151: .get_pinned_cf(self.blocks_cf(), state_hash.0.as_bytes())?
src/store/block_store_impl.rs:154: .with_context(|| format!("{:?}", bytes.to_vec()))
src/store/block_store_impl.rs:162: match self.get_best_block_hash()? {
src/store/block_store_impl.rs:164: Some(state_hash) => Ok(self.get_block(&state_hash)?.map(|b| b.0)),
src/store/block_store_impl.rs:172: .get(Self::BEST_TIP_STATE_HASH_KEY)?
src/store/block_store_impl.rs:178: .get_best_block_hash()?
src/store/block_store_impl.rs:184: .get_best_block_hash()?
src/store/block_store_impl.rs:189: Ok(self.get_best_block_hash()?.and_then(|state_hash| {
src/store/block_store_impl.rs:198: if let Some(old) = self.get_best_block_hash()? {
src/store/block_store_impl.rs:205: let canonicity_updates = self.reorg_canonicity_updates(&old, state_hash)?;
src/store/block_store_impl.rs:206: self.update_canonicity(canonicity_updates)?;
src/store/block_store_impl.rs:209: let balance_updates = self.reorg_account_balance_updates(&old, state_hash)?;
src/store/block_store_impl.rs:210: self.update_account_balances(state_hash, &balance_updates)?;
src/store/block_store_impl.rs:213: let username_updates = self.reorg_username_updates(&old, state_hash)?;
src/store/block_store_impl.rs:214: self.update_usernames(username_updates)?;
src/store/block_store_impl.rs:219: .put(Self::BEST_TIP_STATE_HASH_KEY, state_hash.0.as_bytes())?;
src/store/block_store_impl.rs:222: match self.get_block_height(state_hash)? {
src/store/block_store_impl.rs:229: )))?;
src/store/block_store_impl.rs:240: .get_cf(self.block_parent_hash_cf(), state_hash.0.as_bytes())?
src/store/block_store_impl.rs:254: )?)
src/store/block_store_impl.rs:261: .get_cf(self.block_height_cf(), state_hash.0.as_bytes())?
src/store/block_store_impl.rs:275: )?)
src/store/block_store_impl.rs:282: .get_cf(self.block_global_slot_cf(), state_hash.0.as_bytes())?
src/store/block_store_impl.rs:296: )?)
src/store/block_store_impl.rs:303: .get_cf(self.block_creator_cf(), state_hash.0.as_bytes())?
src/store/block_store_impl.rs:317: )?;
src/store/block_store_impl.rs:328: )?;
src/store/block_store_impl.rs:335: )?)
src/store/block_store_impl.rs:342: .get_cf(self.block_coinbase_receiver_cf(), state_hash.0.as_bytes())?
src/store/block_store_impl.rs:356: )?;
src/store/block_store_impl.rs:367: )?;
src/store/block_store_impl.rs:378: )?)
src/store/block_store_impl.rs:385: .get_cf(self.blocks_at_height_cf(), to_be_bytes(blockchain_length))?
src/store/block_store_impl.rs:397: let num_blocks_at_height = self.get_num_blocks_at_height(blockchain_length)?;
src/store/block_store_impl.rs:402: )?;
src/store/block_store_impl.rs:409: )?)
src/store/block_store_impl.rs:413: let num_blocks_at_height = self.get_num_blocks_at_height(blockchain_length)?;
src/store/block_store_impl.rs:420: )? {
src/store/block_store_impl.rs:422: Some(bytes) => blocks.push(BlockHash::from_bytes(&bytes)?),
src/store/block_store_impl.rs:433: .get_cf(self.blocks_at_global_slot_cf(), to_be_bytes(slot))?
src/store/block_store_impl.rs:441: let num_blocks_at_slot = self.get_num_blocks_at_slot(slot)?;
src/store/block_store_impl.rs:446: )?;
src/store/block_store_impl.rs:453: )?)
src/store/block_store_impl.rs:459: let num_blocks_at_slot = self.get_num_blocks_at_slot(slot)?;
src/store/block_store_impl.rs:465: .get_cf(self.blocks_at_global_slot_cf(), format!("{slot}-{n}"))?
src/store/block_store_impl.rs:468: Some(bytes) => blocks.push(BlockHash::from_bytes(&bytes)?),
src/store/block_store_impl.rs:480: .get_pinned_cf(self.blocks_cf(), pk.to_string().as_bytes())?
src/store/block_store_impl.rs:483: Some(bytes) => String::from_utf8(bytes.to_vec())?.parse()?,
src/store/block_store_impl.rs:496: let num_blocks_at_pk = self.get_num_blocks_at_public_key(pk)?;
src/store/block_store_impl.rs:501: )?;
src/store/block_store_impl.rs:509: )?)
src/store/block_store_impl.rs:515: let num_blocks_at_pk = self.get_num_blocks_at_public_key(pk)?;
src/store/block_store_impl.rs:522: .get_pinned_cf(self.blocks_cf(), key.as_bytes())?
src/store/block_store_impl.rs:525: Some(bytes) => blocks.push(BlockHash::from_bytes(&bytes)?),
src/store/block_store_impl.rs:536: .get_block(state_hash)?
src/store/block_store_impl.rs:539: let blocks_at_next_height = self.get_blocks_at_height(height + 1)?;
src/store/block_store_impl.rs:557: .get_pinned_cf(self.block_version_cf(), key)?
src/store/block_store_impl.rs:566: serde_json::to_vec(&version)?,
src/store/block_store_impl.rs:567: )?)
src/store/block_store_impl.rs:579: .get_block_heights_from_global_slot(global_slot)?
src/store/block_store_impl.rs:587: serde_json::to_vec(&heights)?,
src/store/block_store_impl.rs:588: )?;
src/store/block_store_impl.rs:593: .get_block_global_slots_from_height(blockchain_length)?
src/store/block_store_impl.rs:601: serde_json::to_vec(&slots)?,
src/store/block_store_impl.rs:602: )?;
src/store/block_store_impl.rs:617: )?
src/store/block_store_impl.rs:631: )?
src/store/block_store_impl.rs:637: .get_best_block_hash()?
src/store/block_store_impl.rs:648: )?)
src/store/block_store_impl.rs:655: .get_cf(self.block_epoch_cf(), state_hash.0.as_bytes())?
src/store/block_store_impl.rs:669: )?)
src/store/block_store_impl.rs:679: .get_cf(self.block_genesis_state_hash_cf(), state_hash.0.as_bytes())?
src/store/block_store_impl.rs:728: let acc = self.get_block_production_pk_epoch_count(&creator, Some(epoch))?;
src/store/block_store_impl.rs:733: )?;
src/store/block_store_impl.rs:736: let acc = self.get_block_production_pk_total_count(&creator)?;
src/store/block_store_impl.rs:741: )?;
src/store/block_store_impl.rs:744: let acc = self.get_block_production_epoch_count(Some(epoch))?;
src/store/block_store_impl.rs:749: )?;
src/store/block_store_impl.rs:752: let acc = self.get_block_production_total_count()?;
src/store/block_store_impl.rs:754: .put(Self::TOTAL_NUM_BLOCKS_KEY, to_be_bytes(acc + 1))?;
src/store/block_store_impl.rs:764: let epoch = epoch.unwrap_or(self.get_current_epoch()?);
src/store/block_store_impl.rs:771: )?
src/store/block_store_impl.rs:779: .get_cf(self.block_production_pk_total_cf(), pk.clone().to_bytes())?
src/store/block_store_impl.rs:784: let epoch = epoch.unwrap_or(self.get_current_epoch()?);
src/store/block_store_impl.rs:788: .get_cf(self.block_production_epoch_cf(), to_be_bytes(epoch))?
src/store/block_store_impl.rs:796: .get(Self::TOTAL_NUM_BLOCKS_KEY)?
src/store/block_store_impl.rs:809: serde_json::to_vec(comparison)?,
src/store/block_store_impl.rs:810: )?)
src/store/block_store_impl.rs:820: .get_pinned_cf(self.block_comparison_cf(), state_hash.0.as_bytes())?
src/store/block_store_impl.rs:839: let bc1: BlockComparison = serde_json::from_slice(&bytes1)?;
src/store/block_store_impl.rs:840: let bc2: BlockComparison = serde_json::from_slice(&bytes2)?;
src/store/block_store_impl.rs:849: let mut file = File::create(path)?;
src/store/block_store_impl.rs:855: let state_hash = block_state_hash_from_key(&key)?;
src/store/block_store_impl.rs:856: let block_height = block_u32_prefix_from_key(&key)?;
src/store/block_store_impl.rs:858: .get_block_global_slot(&state_hash)?
src/store/block_store_impl.rs:864: )?;
src/store/block_store_impl.rs:873: let state_hash = block_state_hash_from_key(&key)?;
src/store/block_store_impl.rs:874: blocks.push(self.get_block(&state_hash)?.expect("PCB").0);
src/store/block_store_impl.rs:882: let mut file = File::create(path)?;
src/store/block_store_impl.rs:888: let state_hash = block_state_hash_from_key(&key)?;
src/store/block_store_impl.rs:889: let block_height = block_u32_prefix_from_key(&key)?;
src/store/block_store_impl.rs:891: .get_block_global_slot(&state_hash)?
src/store/block_store_impl.rs:897: )?;
src/store/block_store_impl.rs:909: let state_hash = block_state_hash_from_key(&key)?;
src/store/block_store_impl.rs:910: blocks.push(self.get_block(&state_hash)?.expect("PCB").0);
src/store/block_store_impl.rs:956: format!("{} from {start:?}", display_direction(direction))
src/store/internal_command_store_impl.rs:23: serde_json::to_vec(&internal_cmds)?,
src/store/internal_command_store_impl.rs:24: )?;
src/store/internal_command_store_impl.rs:27: self.set_block_internal_commands_count(&block.state_hash(), internal_cmds.len() as u32)?;
src/store/internal_command_store_impl.rs:38: self.increment_internal_commands_counts(internal_cmd, epoch)?;
src/store/internal_command_store_impl.rs:54: serde_json::to_vec(&int_cmd)?,
src/store/internal_command_store_impl.rs:55: )?;
src/store/internal_command_store_impl.rs:61: let n = self.get_pk_num_internal_commands(&pk.0)?.unwrap_or(0);
src/store/internal_command_store_impl.rs:76: serde_json::to_vec(&pk_internal_cmds_with_data)?,
src/store/internal_command_store_impl.rs:77: )?;
src/store/internal_command_store_impl.rs:86: )?;
src/store/internal_command_store_impl.rs:96: let block = self.get_block(state_hash)?.expect("block to exist").0;
src/store/internal_command_store_impl.rs:101: .get_pinned_cf(self.internal_commands_cf(), key.as_bytes())?
src/store/internal_command_store_impl.rs:103: let res: Vec<InternalCommand> = serde_json::from_slice(&commands_bytes)?;
src/store/internal_command_store_impl.rs:124: if let Some(n) = self.get_pk_num_internal_commands(&pk.0)? {
src/store/internal_command_store_impl.rs:128: .get_pinned_cf(commands_cf, key_n(pk.0.clone(), m))?
src/store/internal_command_store_impl.rs:150: .get_pinned_cf(self.internal_commands_cf(), key.as_bytes())?
src/store/internal_command_store_impl.rs:167: let epoch = epoch.unwrap_or(self.get_current_epoch()?);
src/store/internal_command_store_impl.rs:171: .get_pinned_cf(self.internal_commands_epoch_cf(), to_be_bytes(epoch))?
src/store/internal_command_store_impl.rs:177: let old = self.get_internal_commands_epoch_count(Some(epoch))?;
src/store/internal_command_store_impl.rs:182: )?)
src/store/internal_command_store_impl.rs:189: .get(Self::TOTAL_NUM_FEE_TRANSFERS_KEY)?
src/store/internal_command_store_impl.rs:196: let old = self.get_internal_commands_total_count()?;
src/store/internal_command_store_impl.rs:199: .put(Self::TOTAL_NUM_FEE_TRANSFERS_KEY, to_be_bytes(old + 1))?)
src/store/internal_command_store_impl.rs:207: let epoch = epoch.unwrap_or(self.get_current_epoch()?);
src/store/internal_command_store_impl.rs:214: )?
src/store/internal_command_store_impl.rs:225: let old = self.get_internal_commands_pk_epoch_count(pk, Some(epoch))?;
src/store/internal_command_store_impl.rs:230: )?)
src/store/internal_command_store_impl.rs:237: .get_pinned_cf(self.internal_commands_pk_total_cf(), pk.0.as_bytes())?
src/store/internal_command_store_impl.rs:244: let old = self.get_internal_commands_pk_total_count(pk)?;
src/store/internal_command_store_impl.rs:249: )?)
src/store/internal_command_store_impl.rs:262: )?
src/store/internal_command_store_impl.rs:276: )?)
src/store/internal_command_store_impl.rs:291: "Incrementing internal command counts {:?}",
src/store/internal_command_store_impl.rs:296: self.increment_internal_commands_pk_epoch_count(sender, epoch)?;
src/store/internal_command_store_impl.rs:297: self.increment_internal_commands_pk_total_count(sender)?;
src/store/internal_command_store_impl.rs:301: self.increment_internal_commands_pk_epoch_count(receiver, epoch)?;
src/store/internal_command_store_impl.rs:302: self.increment_internal_commands_pk_total_count(receiver)?;
src/store/internal_command_store_impl.rs:306: self.increment_internal_commands_epoch_count(epoch)?;
src/store/snark_store_impl.rs:61: let value = serde_json::to_vec(&completed_works)?;
src/store/snark_store_impl.rs:62: self.database.put_cf(self.snarks_cf(), key, value)?;
src/store/snark_store_impl.rs:65: self.set_block_snarks_count(&block.state_hash(), completed_works.len() as u32)?;
src/store/snark_store_impl.rs:81: )?;
src/store/snark_store_impl.rs:97: let n = self.get_pk_num_prover_blocks(&pk_str)?.unwrap_or(0);
src/store/snark_store_impl.rs:108: let value = serde_json::to_vec(&block_pk_snarks)?;
src/store/snark_store_impl.rs:109: self.database.put_cf(self.snarks_cf(), key, value)?;
src/store/snark_store_impl.rs:115: self.database.put_cf(self.snarks_cf(), key, value)?;
src/store/snark_store_impl.rs:124: )?
src/store/snark_store_impl.rs:128: self.set_snark_by_prover(&snark, global_slot, index as u32)?;
src/store/snark_store_impl.rs:129: self.set_snark_by_prover_height(&snark, block_height, index as u32)?;
src/store/snark_store_impl.rs:130: self.increment_snarks_counts(&snark, epoch)?;
src/store/snark_store_impl.rs:142: .get_pinned_cf(self.snarks_cf(), key)?
src/store/snark_store_impl.rs:163: if let Some(n) = self.get_pk_num_prover_blocks(&pk)? {
src/store/snark_store_impl.rs:167: .get_pinned_cf(snarks_cf, key_n(pk.clone(), m))?
src/store/snark_store_impl.rs:192: if let Some(snarks_bytes) = self.database.get_pinned_cf(self.snarks_cf(), key)? {
src/store/snark_store_impl.rs:193: return Ok(Some(serde_json::from_slice(&snarks_bytes)?));
src/store/snark_store_impl.rs:209: .get_pinned_cf(self.snark_top_producers_cf(), key)?
src/store/snark_store_impl.rs:219: )?
src/store/snark_store_impl.rs:228: .put_cf(self.snark_top_producers_sort_cf(), key, b"")?
src/store/snark_store_impl.rs:275: serde_json::to_vec(snark)?,
src/store/snark_store_impl.rs:276: )?)
src/store/snark_store_impl.rs:301: serde_json::to_vec(snark)?,
src/store/snark_store_impl.rs:302: )?)
src/store/snark_store_impl.rs:316: let epoch = epoch.unwrap_or(self.get_current_epoch()?);
src/store/snark_store_impl.rs:320: .get_pinned_cf(self.snarks_epoch_cf(), to_be_bytes(epoch))?
src/store/snark_store_impl.rs:326: let old = self.get_snarks_epoch_count(Some(epoch))?;
src/store/snark_store_impl.rs:331: )?)
src/store/snark_store_impl.rs:338: .get(Self::TOTAL_NUM_SNARKS_KEY)?
src/store/snark_store_impl.rs:345: let old = self.get_snarks_total_count()?;
src/store/snark_store_impl.rs:348: .put(Self::TOTAL_NUM_SNARKS_KEY, to_be_bytes(old + 1))?)
src/store/snark_store_impl.rs:352: let epoch = epoch.unwrap_or(self.get_current_epoch()?);
src/store/snark_store_impl.rs:356: .get_pinned_cf(self.snarks_pk_epoch_cf(), u32_prefix_key(epoch, &pk.0))?
src/store/snark_store_impl.rs:363: let old = self.get_snarks_pk_epoch_count(pk, Some(epoch))?;
src/store/snark_store_impl.rs:368: )?)
src/store/snark_store_impl.rs:375: .get_pinned_cf(self.snarks_pk_total_cf(), pk.0.as_bytes())?
src/store/snark_store_impl.rs:382: let old = self.get_snarks_pk_total_count(pk)?;
src/store/snark_store_impl.rs:387: )?)
src/store/snark_store_impl.rs:394: .get_pinned_cf(self.block_snark_counts_cf(), state_hash.0.as_bytes())?
src/store/snark_store_impl.rs:404: )?)
src/store/snark_store_impl.rs:408: trace!("Incrementing SNARKs count {snark:?}");
src/store/snark_store_impl.rs:412: self.increment_snarks_pk_epoch_count(&prover, epoch)?;
src/store/snark_store_impl.rs:413: self.increment_snarks_pk_total_count(&prover)?;
src/store/snark_store_impl.rs:416: self.increment_snarks_epoch_count(epoch)?;
src/store/chain_store_impl.rs:27: )?;
src/store/chain_store_impl.rs:30: self.database.put(Self::CHAIN_ID_KEY, chain_bytes)?;
src/store/chain_store_impl.rs:38: .get_pinned_cf(self.chain_id_to_network_cf(), chain_id.0.as_bytes())?
src/store/chain_store_impl.rs:46: self.get_network(&self.get_chain_id()?)
src/store/chain_store_impl.rs:53: .get(Self::CHAIN_ID_KEY)?
src/store/chain_store_impl.rs:55: )?))
src/store/mod.rs:181: )?,
src/store/mod.rs:189: )?;
src/store/mod.rs:191: persist_indexer_version(&version, path)?;
src/store/mod.rs:201: Checkpoint::new(&self.database)?
src/store/mod.rs:205: persist_indexer_version(&IndexerStoreVersion::default(), &snapshot_temp_dir)?;
src/store/mod.rs:211: .with_context(|| format!("Failed to remove directory {snapshot_temp_dir:#?})"))
src/store/mod.rs:213: .map(|_| format!("Snapshot created and saved as {output_file:#?}"))
src/store/mod.rs:239: )?,
src/store/mod.rs:248: bail!("Snapshot file {snapshot_file:#?} does not exist")
src/store/mod.rs:250: bail!("Restore dir {restore_dir:#?} must not exist")
src/store/mod.rs:253: .with_context(|| format!("Failed to extract archive file {snapshot_file:#?}"))
src/store/mod.rs:267: fs::create_dir_all(output_dir)?;
src/store/mod.rs:269: let mut archive = tar::Archive::new(BufReader::new(File::open(archive_file)?));
src/store/mod.rs:280: let mut archive = tar::Builder::new(BufWriter::new(File::create(output_file)?));
src/store/mod.rs:281: read_dir(input_dir)?
src/store/mod.rs:300: "apply: {:#?}\nunapply: {:#?}",
src/store/mod.rs:456: let serialized = serde_json::to_string(indexer_version)?;
src/store/mod.rs:457: let mut file = std::fs::File::create(versioned)?;
src/store/mod.rs:458: file.write_all(serialized.as_bytes())?;
src/store/event_store_impl.rs:15: let seq_num = self.get_next_seq_num()?;
src/store/event_store_impl.rs:16: trace!("Adding event {seq_num}: {event:?}");
src/store/event_store_impl.rs:38: value.append(&mut serde_json::to_vec(&event)?);
src/store/event_store_impl.rs:40: .put_cf(self.events_cf(), seq_num.to_be_bytes(), value)?;
src/store/event_store_impl.rs:45: .put(Self::NEXT_EVENT_SEQ_NUM_KEY, next_seq_num.to_be_bytes())?;
src/store/event_store_impl.rs:55: .get_pinned_cf(self.events_cf(), seq_num.to_be_bytes())?
src/store/event_store_impl.rs:63: .get(Self::NEXT_EVENT_SEQ_NUM_KEY)?
src/store/event_store_impl.rs:70: for n in 0..self.get_next_seq_num()? {
src/store/event_store_impl.rs:71: if let Some(event) = self.get_event(n)? {
src/store/account_store_impl.rs:35: let a_length = self.get_block_height(&a)?.expect("a has a length");
src/store/account_store_impl.rs:36: let b_length = self.get_block_height(&b)?.expect("b has a length");
src/store/account_store_impl.rs:46: apply.append(&mut self.get_block_balance_updates(&b)?.unwrap());
src/store/account_store_impl.rs:47: b = self.get_block_parent_hash(&b)?.expect("b has a parent");
src/store/account_store_impl.rs:51: let mut a_prev = self.get_block_parent_hash(&a)?.expect("a has a parent");
src/store/account_store_impl.rs:52: let mut b_prev = self.get_block_parent_hash(&b)?.expect("b has a parent");
src/store/account_store_impl.rs:56: unapply.append(&mut self.get_block_balance_updates(&a)?.unwrap());
src/store/account_store_impl.rs:57: apply.append(&mut self.get_block_balance_updates(&b)?.unwrap());
src/store/account_store_impl.rs:63: a_prev = self.get_block_parent_hash(&a)?.expect("a has a parent");
src/store/account_store_impl.rs:64: b_prev = self.get_block_parent_hash(&b)?.expect("b has a parent");
src/store/account_store_impl.rs:78: .get_pinned_cf(self.account_balance_updates_cf(), state_hash.0.as_bytes())?
src/store/account_store_impl.rs:97: self.update_num_accounts(count(&updates.apply) - count(&updates.unapply))?;
src/store/account_store_impl.rs:102: let balance = self.get_account_balance(&pk)?.unwrap_or_default();
src/store/account_store_impl.rs:110: self.update_account_balance(&pk, Some(balance))?;
src/store/account_store_impl.rs:113: self.update_account_balance(&pk, None)?;
src/store/account_store_impl.rs:127: .get(Self::TOTAL_NUM_ACCOUNTS_KEY)?
src/store/account_store_impl.rs:132: )?;
src/store/account_store_impl.rs:137: .get(Self::TOTAL_NUM_ACCOUNTS_KEY)?
src/store/account_store_impl.rs:142: )?;
src/store/account_store_impl.rs:151: .get(Self::TOTAL_NUM_ACCOUNTS_KEY)?
src/store/account_store_impl.rs:159: let b = self.get_account_balance(pk)?.unwrap_or_default();
src/store/account_store_impl.rs:161: .delete_cf(self.account_balance_cf(), pk.0.as_bytes())?;
src/store/account_store_impl.rs:163: .delete_cf(self.account_balance_sort_cf(), u64_prefix_key(b, &pk.0))?;
src/store/account_store_impl.rs:169: if let Some(old) = self.get_account_balance(pk)? {
src/store/account_store_impl.rs:172: .delete_cf(self.account_balance_sort_cf(), u64_prefix_key(old, &pk.0))?;
src/store/account_store_impl.rs:178: )?;
src/store/account_store_impl.rs:185: )?;
src/store/account_store_impl.rs:198: serde_json::to_vec(balance_updates)?,
src/store/account_store_impl.rs:199: )?;
src/store/account_store_impl.rs:208: .get_pinned_cf(self.account_balance_cf(), pk.0.as_bytes())?
src/store/user_command_store_impl.rs:27: self.set_block_user_commands(block)?;
src/store/user_command_store_impl.rs:28: self.set_block_user_commands_count(&state_hash, user_commands.len() as u32)?;
src/store/user_command_store_impl.rs:29: self.set_block_username_updates(&state_hash, &block.username_updates())?;
src/store/user_command_store_impl.rs:34: let txn_hash = signed.hash_signed_command()?;
src/store/user_command_store_impl.rs:47: ))?,
src/store/user_command_store_impl.rs:48: )?;
src/store/user_command_store_impl.rs:51: self.set_user_command_state_hash(state_hash.clone(), &txn_hash)?;
src/store/user_command_store_impl.rs:62: )?;
src/store/user_command_store_impl.rs:69: )?;
src/store/user_command_store_impl.rs:72: self.increment_user_commands_counts(command, epoch)?;
src/store/user_command_store_impl.rs:80: )?;
src/store/user_command_store_impl.rs:93: )?;
src/store/user_command_store_impl.rs:104: )?;
src/store/user_command_store_impl.rs:117: )?;
src/store/user_command_store_impl.rs:128: )?;
src/store/user_command_store_impl.rs:135: .get_pk_num_user_commands_blocks(&pk)?
src/store/user_command_store_impl.rs:156: serde_json::to_vec(&block_pk_commands)?,
src/store/user_command_store_impl.rs:157: )?;
src/store/user_command_store_impl.rs:164: )?;
src/store/user_command_store_impl.rs:198: )?
src/store/user_command_store_impl.rs:209: .get_pinned_cf(self.user_command_state_hashes_cf(), txn_hash.as_bytes())?
src/store/user_command_store_impl.rs:220: .get_user_command_state_hashes(txn_hash)?
src/store/user_command_store_impl.rs:237: )?;
src/store/user_command_store_impl.rs:243: serde_json::to_vec(&blocks)?,
src/store/user_command_store_impl.rs:244: )?;
src/store/user_command_store_impl.rs:254: serde_json::to_vec(&block.commands())?,
src/store/user_command_store_impl.rs:255: )?)
src/store/user_command_store_impl.rs:265: .get_pinned_cf(self.user_commands_per_block_cf(), state_hash.0.as_bytes())?
src/store/user_command_store_impl.rs:280: if let Some(n) = self.get_pk_num_user_commands_blocks(pk)? {
src/store/user_command_store_impl.rs:285: .get_pinned_cf(self.user_commands_pk_cf(), key_n(pk, m))?
src/store/user_command_store_impl.rs:307: let start_block_opt = self.get_block(start_state_hash)?.map(|b| b.0);
src/store/user_command_store_impl.rs:308: let end_block_opt = self.get_block(end_state_hash)?.map(|b| b.0);
src/store/user_command_store_impl.rs:310: "Getting user commands between {:?} and {:?}",
src/store/user_command_store_impl.rs:327: while let Some((block, _)) = self.get_block(&prev_hash)? {
src/store/user_command_store_impl.rs:357: )?
src/store/user_command_store_impl.rs:402: .get_cf(self.user_commands_pk_num_cf(), pk.0.as_bytes())?
src/store/user_command_store_impl.rs:407: let epoch = epoch.unwrap_or(self.get_current_epoch()?);
src/store/user_command_store_impl.rs:411: .get_pinned_cf(self.user_commands_epoch_cf(), to_be_bytes(epoch))?
src/store/user_command_store_impl.rs:417: let old = self.get_user_commands_epoch_count(Some(epoch))?;
src/store/user_command_store_impl.rs:422: )?)
src/store/user_command_store_impl.rs:429: .get(Self::TOTAL_NUM_USER_COMMANDS_KEY)?
src/store/user_command_store_impl.rs:436: let old = self.get_user_commands_total_count()?;
src/store/user_command_store_impl.rs:439: .put(Self::TOTAL_NUM_USER_COMMANDS_KEY, to_be_bytes(old + 1))?)
src/store/user_command_store_impl.rs:447: let epoch = epoch.unwrap_or(self.get_current_epoch()?);
src/store/user_command_store_impl.rs:454: )?
src/store/user_command_store_impl.rs:465: let old = self.get_user_commands_pk_epoch_count(pk, Some(epoch))?;
src/store/user_command_store_impl.rs:470: )?)
src/store/user_command_store_impl.rs:477: .get_pinned_cf(self.user_commands_pk_total_cf(), pk.0.as_bytes())?
src/store/user_command_store_impl.rs:484: let old = self.get_user_commands_pk_total_count(pk)?;
src/store/user_command_store_impl.rs:489: )?)
src/store/user_command_store_impl.rs:502: )?)
src/store/user_command_store_impl.rs:509: .get_pinned_cf(self.block_user_command_counts_cf(), state_hash.0.as_bytes())?
src/store/user_command_store_impl.rs:519: "Incrementing user commands counts {:?}",
src/store/user_command_store_impl.rs:525: self.increment_user_commands_pk_epoch_count(&sender, epoch)?;
src/store/user_command_store_impl.rs:526: self.increment_user_commands_pk_total_count(&sender)?;
src/store/user_command_store_impl.rs:531: self.increment_user_commands_pk_epoch_count(&receiver, epoch)?;
src/store/user_command_store_impl.rs:532: self.increment_user_commands_pk_total_count(&receiver)?;
src/store/user_command_store_impl.rs:536: self.increment_user_commands_epoch_count(epoch)?;
src/unix_socket_server.rs:39: panic!("Unable to bind to Unix domain socket file {domain_socket_path:#?} due to {e}")
src/unix_socket_server.rs:41: info!("Created Unix domain socket server at {domain_socket_path:#?}");
src/unix_socket_server.rs:47: stream.readable().await?;
src/unix_socket_server.rs:63: bincode::decode_from_slice(&buffer, BIN_CODE_CONFIG)?;
src/unix_socket_server.rs:81: }?;
src/unix_socket_server.rs:90: let command = parse_conn_to_cli(&connection).await?;
src/unix_socket_server.rs:98: if let Some(best_tip) = db.get_best_block()? {
src/unix_socket_server.rs:100: db.get_ledger_state_hash(&best_tip.state_hash(), false)?
src/unix_socket_server.rs:131: if let Some(best_tip) = db.get_best_block()? {
src/unix_socket_server.rs:133: db.get_block_canonicity(&best_tip.state_hash())?
src/unix_socket_server.rs:136: serde_json::to_string_pretty(&best_tip.with_canonicity(canonicity))?
src/unix_socket_server.rs:140: serde_json::to_string_pretty(&block)?
src/unix_socket_server.rs:148: info!("Writing best tip block to {:?}", path);
src/unix_socket_server.rs:149: std::fs::write(path, block_str)?;
src/unix_socket_server.rs:171: db.get_block_canonicity(&block.state_hash())?
src/unix_socket_server.rs:174: serde_json::to_string_pretty(&block.with_canonicity(canonicity))?
src/unix_socket_server.rs:177: serde_json::to_string_pretty(&block)?
src/unix_socket_server.rs:184: info!("Writing block {state_hash} to {:?}", path);
src/unix_socket_server.rs:185: std::fs::write(path, block_str)?;
src/unix_socket_server.rs:187: "Block {} written to {:?}",
src/unix_socket_server.rs:208: let blocks_at_height = db.get_blocks_at_height(height)?;
src/unix_socket_server.rs:228: serde_json::to_string(&blocks)?
src/unix_socket_server.rs:259: std::fs::write(path.clone(), blocks_str)?;
src/unix_socket_server.rs:275: let slot: u32 = slot.parse()?;
src/unix_socket_server.rs:276: let blocks_at_slot = db.get_blocks_at_slot(slot)?;
src/unix_socket_server.rs:296: serde_json::to_string(&blocks)?
src/unix_socket_server.rs:327: std::fs::write(path.clone(), blocks_str)?;
src/unix_socket_server.rs:346: let blocks_at_pk = db.get_blocks_at_public_key(&pk.clone().into())?;
src/unix_socket_server.rs:368: serde_json::to_string(&blocks)?
src/unix_socket_server.rs:403: std::fs::write(path.clone(), blocks_str)?;
src/unix_socket_server.rs:420: let children = db.get_block_children(&state_hash.clone().into())?;
src/unix_socket_server.rs:440: serde_json::to_string(&blocks)?
src/unix_socket_server.rs:475: std::fs::write(path.clone(), blocks_str)?;
src/unix_socket_server.rs:496: if let Some(best_tip) = db.get_best_block()? {
src/unix_socket_server.rs:513: db.get_block(&end_state_hash.into())?,
src/unix_socket_server.rs:514: db.get_block(&start_state_hash)?,
src/unix_socket_server.rs:523: if let Some((parent_pcb, _)) = db.get_block(&parent_hash)? {
src/unix_socket_server.rs:549: serde_json::to_string(&best_chain)?
src/unix_socket_server.rs:576: std::fs::write(path.clone(), best_chain_str)?;
src/unix_socket_server.rs:600: if let Some(best_tip) = db.get_best_block()? {
src/unix_socket_server.rs:602: db.get_ledger_state_hash(&best_tip.state_hash(), false)?
src/unix_socket_server.rs:616: std::fs::write(path.clone(), ledger)?;
src/unix_socket_server.rs:639: db.get_ledger_state_hash(&hash.clone().into(), true)?
src/unix_socket_server.rs:650: std::fs::write(path.clone(), ledger)?;
src/unix_socket_server.rs:666: if let Some(ledger) = db.get_ledger(&LedgerHash(hash.clone()))? {
src/unix_socket_server.rs:676: std::fs::write(path.clone(), ledger)?;
src/unix_socket_server.rs:703: .get_ledger_at_height(height, true)?
src/unix_socket_server.rs:717: std::fs::write(&path, ledger_str)?;
src/unix_socket_server.rs:740: db.get_staking_ledger_by_hash(&hash.clone().into(), None, None)?
src/unix_socket_server.rs:742: let ledger_json = serde_json::to_string_pretty(&staking_ledger)?;
src/unix_socket_server.rs:751: std::fs::write(path.clone(), ledger_json)?;
src/unix_socket_server.rs:779: db.get_staking_ledger_at_epoch(epoch, Some(genesis_state_hash.into()))?
src/unix_socket_server.rs:781: let ledger_json = serde_json::to_string_pretty(&staking_ledger)?;
src/unix_socket_server.rs:791: std::fs::write(path.clone(), ledger_json)?;
src/unix_socket_server.rs:822: db.get_delegations_epoch(epoch, &Some(genesis_state_hash.into()))?
src/unix_socket_server.rs:852: )?)
src/unix_socket_server.rs:868: db.get_delegations_epoch(epoch, &Some(genesis_state_hash.into()))?;
src/unix_socket_server.rs:887: std::fs::write(&path, agg_del_str)?;
src/unix_socket_server.rs:917: .get_snark_work_by_public_key(&pk.clone().into())?
src/unix_socket_server.rs:933: std::fs::write(&path, snarks_str)?;
src/unix_socket_server.rs:950: db.get_snark_work_in_block(&state_hash.clone().into())?
src/unix_socket_server.rs:980: &db.get_top_snark_workers_by_fees(num)?,
src/unix_socket_server.rs:981: )?)
src/unix_socket_server.rs:988: .await?;
src/unix_socket_server.rs:1015: std::fs::write(&path, summary_str)?;
src/unix_socket_server.rs:1035: if let Some(best_tip) = db.get_best_block()? {
src/unix_socket_server.rs:1054: .get_user_commands_for_public_key(&pk.clone().into())?
src/unix_socket_server.rs:1072: std::fs::write(&path, transaction_str)?;
src/unix_socket_server.rs:1088: db.get_user_command(&hash, 0)?.map(|cmd| {
src/unix_socket_server.rs:1090: format!("{cmd:?}")
src/unix_socket_server.rs:1093: format!("{cmd:?}")
src/unix_socket_server.rs:1151: db.get_internal_commands_public_key(&pk.clone().into())?;
src/unix_socket_server.rs:1152: let internal_cmds_str = serde_json::to_string_pretty(&internal_cmds)?;
src/unix_socket_server.rs:1166: std::fs::write(&path, internal_cmds_str)?;
src/unix_socket_server.rs:1185: &db.get_internal_commands(&state_hash.clone().into())?,
src/unix_socket_server.rs:1186: )?;
src/unix_socket_server.rs:1203: std::fs::write(&path, internal_cmds_str)?;
src/unix_socket_server.rs:1217: Some(format!("mina-indexer database v{}", db.get_db_version()?))
src/unix_socket_server.rs:1224: serde_json::to_string("no response 404")?
src/unix_socket_server.rs:1226: writer.write_all(response.as_bytes()).await?;
src/unix_socket_server.rs:1240: warn!("Unix domain socket: {unix_socket_path:?} already in use. Replacing old vestige");
src/unix_socket_server.rs:1241: remove_unix_socket(unix_socket_path)?;
src/unix_socket_server.rs:1249: std::fs::remove_file(unix_socket_path)?;
src/unix_socket_server.rs:1250: debug!("Removed Unix domain socket: {:?}", unix_socket_path);
src/unix_socket_server.rs:1292: let pp = format!("{vec:#?}");
src/unix_socket_server.rs:1298: T: ?Sized + serde::Serialize + std::fmt::Display,
src/web/graphql/blocks/mod.rs:42: let epoch_num_blocks = db.get_block_production_epoch_count(None)?;
src/web/graphql/blocks/mod.rs:43: let total_num_blocks = db.get_block_production_total_count()?;
src/web/graphql/blocks/mod.rs:84: })?);
src/web/graphql/blocks/mod.rs:93: let pcb = match db.get_block(&state_hash.clone().into())? {
src/web/graphql/blocks/mod.rs:136: let state_hash = block_state_hash_from_key(&key)?;
src/web/graphql/blocks/mod.rs:193: if let Some(best_height) = db.get_best_block_height()? {
src/web/graphql/blocks/mod.rs:208: let state_hash = block_state_hash_from_key(&key)?;
src/web/graphql/blocks/mod.rs:209: if let Some(creator) = db.get_block_creator(&state_hash)? {
src/web/graphql/blocks/mod.rs:222: let epoch_num_blocks = db.get_block_production_epoch_count(None)?;
src/web/graphql/blocks/mod.rs:223: let total_num_blocks = db.get_block_production_total_count()?;
src/web/graphql/blocks/mod.rs:253: let block = db.get_block(&state_hash.clone().into())?;
src/web/graphql/blocks/mod.rs:262: for state_hash in db.get_blocks_at_height(block_height)?.iter() {
src/web/graphql/blocks/mod.rs:282: for state_hash in db.get_blocks_at_slot(global_slot)?.iter() {
src/web/graphql/blocks/mod.rs:314: let state_hash = block_state_hash_from_key(&key)?;
src/web/graphql/blocks/mod.rs:356: let state_hash = block_state_hash_from_key(&key)?;
src/web/graphql/blocks/mod.rs:394: (None, None) => db.get_best_block_height()?.unwrap(),
src/web/graphql/blocks/mod.rs:406: let height = block_u32_prefix_from_key(&key)?;
src/web/graphql/blocks/mod.rs:411: let state_hash = block_state_hash_from_key(&key)?;
src/web/graphql/blocks/mod.rs:458: (None, None) => db.get_best_block_global_slot()?.unwrap(),
src/web/graphql/blocks/mod.rs:470: let slot = block_u32_prefix_from_key(&key)?;
src/web/graphql/blocks/mod.rs:475: let state_hash = block_state_hash_from_key(&key)?;
src/web/graphql/blocks/mod.rs:500: let state_hash = block_state_hash_from_key(&key)?;
src/web/graphql/blocks/mod.rs:502: .get_block(&state_hash)?
src/web/graphql/feetransfers/mod.rs:65: let epoch_num_blocks = db.get_block_production_epoch_count(None)?;
src/web/graphql/feetransfers/mod.rs:66: let total_num_blocks = db.get_block_production_total_count()?;
src/web/graphql/feetransfers/mod.rs:67: let epoch_num_user_commands = db.get_user_commands_epoch_count(None)?;
src/web/graphql/feetransfers/mod.rs:68: let total_num_user_commands = db.get_user_commands_total_count()?;
src/web/graphql/feetransfers/mod.rs:72: .get_block_snarks_count(&block.state_hash())?
src/web/graphql/feetransfers/mod.rs:75: .get_block_user_commands_count(&block.state_hash())?
src/web/graphql/feetransfers/mod.rs:78: .get_block_internal_commands_count(&block.state_hash())?
src/web/graphql/feetransfers/mod.rs:160: let epoch_num_internal_commands = db.get_internal_commands_epoch_count(None)?;
src/web/graphql/feetransfers/mod.rs:161: let total_num_internal_commands = db.get_internal_commands_total_count()?;
src/web/graphql/feetransfers/mod.rs:207: (None, None) => db.get_best_block_height()?.unwrap(),
src/web/graphql/feetransfers/mod.rs:219: for state_hash in db.get_blocks_at_height(height)?.iter() {
src/web/graphql/feetransfers/mod.rs:222: .get_block(state_hash)?
src/web/graphql/feetransfers/mod.rs:255: .get_internal_commands_public_key(&recipient.into())?
src/web/graphql/feetransfers/mod.rs:308: let internal_command = serde_json::from_slice::<InternalCommandWithData>(&value)?;
src/web/graphql/transactions/mod.rs:38: let epoch_num_user_commands = db.get_user_commands_epoch_count(None)?;
src/web/graphql/transactions/mod.rs:39: let total_num_user_commands = db.get_user_commands_total_count()?;
src/web/graphql/transactions/mod.rs:43: return Ok(db.get_user_command(&hash, 0)?.map(|cmd| {
src/web/graphql/transactions/mod.rs:60: let epoch_num_user_commands = db.get_user_commands_epoch_count(None)?;
src/web/graphql/transactions/mod.rs:61: let total_num_user_commands = db.get_user_commands_total_count()?;
src/web/graphql/transactions/mod.rs:73: .get_block(&state_hash.into())?
src/web/graphql/transactions/mod.rs:109: 'outer: for state_hash in db.get_blocks_at_height(block_height)? {
src/web/graphql/transactions/mod.rs:169: .get_user_command_state_hash(&txn_hash, &txn_state_hash)?
src/web/graphql/transactions/mod.rs:213: (None, None) => db.get_best_block_height()?.unwrap(),
src/web/graphql/transactions/mod.rs:225: for state_hash in db.get_blocks_at_height(height)? {
src/web/graphql/transactions/mod.rs:273: let txn_hash = user_commands_iterator_txn_hash(&key)?;
src/web/graphql/transactions/mod.rs:274: let state_hash = user_commands_iterator_state_hash(&key)?;
src/web/graphql/transactions/mod.rs:276: db.get_user_command_state_hash(&txn_hash, &state_hash)?
src/web/graphql/accounts/mod.rs:150: let pk = PublicKey::from_bytes(&key[8..])?;
src/web/graphql/snarks/mod.rs:114: .get_block(&state_hash.into())?
src/web/graphql/snarks/mod.rs:136: .get_blocks_at_height(block_height)?
src/web/graphql/snarks/mod.rs:185: let blocks_at_height = db.get_blocks_at_height(block_height)?;
src/web/graphql/snarks/mod.rs:189: .get_block(&state_hash)?
src/web/graphql/snarks/mod.rs:193: let snark = serde_json::from_slice(&snark)?;
src/web/graphql/snarks/mod.rs:239: let blocks_at_slot = db.get_blocks_at_slot(global_slot)?;
src/web/graphql/snarks/mod.rs:243: .get_block(&state_hash)?
src/web/graphql/snarks/mod.rs:247: let snark = serde_json::from_slice(&snark)?;
src/web/graphql/snarks/mod.rs:297: (None, None) => db.get_best_block_height()?.unwrap(),
src/web/graphql/snarks/mod.rs:308: for state_hash in db.get_blocks_at_height(height)? {
src/web/graphql/snarks/mod.rs:311: .get_block(&state_hash)?
src/web/graphql/snarks/mod.rs:315: let snark_work = db.get_snark_work_in_block(&state_hash)?;
src/web/graphql/snarks/mod.rs:354: let state_hash = block_state_hash_from_key(&key)?;
src/web/graphql/snarks/mod.rs:355: let block = db.get_block(&state_hash)?.expect("block to be returned").0;
src/web/graphql/snarks/mod.rs:357: let snark_work = db.get_snark_work_in_block(&state_hash)?;
src/web/graphql/snarks/mod.rs:396: .get_block(&snark.state_hash.clone().into())?
src/web/graphql/stakes/mod.rs:65: let curr_epoch = db.get_current_epoch()?;
src/web/graphql/stakes/mod.rs:74: return match db.get_epoch(&ledger_hash.clone().into())? {
src/web/graphql/stakes/mod.rs:91: db.get_staking_ledger_by_hash(&ledger_hash.into(), query_epoch, None)?
src/web/graphql/stakes/mod.rs:93: db.get_staking_ledger_at_epoch(epoch, None)?
src/web/graphql/stakes/mod.rs:105: let delegations = db.get_delegations_epoch(epoch, &None)?.unwrap();
src/web/graphql/stakes/mod.rs:135: let account: StakingAccount = serde_json::from_slice(&value)?;
src/web/graphql/staged_ledgers/mod.rs:43: .get_ledger(&ledger_hash.into())?
src/web/graphql/staged_ledgers/mod.rs:60: .get_ledger_state_hash(&state_hash.into(), true)?
src/web/graphql/staged_ledgers/mod.rs:77: .get_ledger_at_height(blockchain_length, true)?
src/web/rest/accounts.rs:43: debug!("Found account in ledger: {:?}", account);
src/web/rest/locked_balances.rs:25: let record: Record = result?;
src/web/rest/blocks.rs:28: format!("{blocks:#?}").replace(",\n]", "\n]")
src/web/rest/blocks.rs:84: .body(format!("{block:?}"));
src/web/rest/blockchain.rs:243: trace!("Blockchain summary: {summary:?}");
There is no end goal to this issue but I want people to think about how we handle errors. Sometimes it makes sense to pass the error up the call stack but other times it's worth explicitly handling when it happens.
The pros:
The cons: