Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
09079d4
feat: sqlite indexer
hanabi1224 Mar 9, 2026
665b16a
Merge remote-tracking branch 'origin/main' into hm/sqlite-indexer
hanabi1224 Mar 11, 2026
cf02a81
fix spellcheck
hanabi1224 Mar 11, 2026
0a5f498
cli tool
hanabi1224 Mar 12, 2026
3888ede
fix: broadcast HeadChange::Revert(Tipset) in set_heaviest_tipset
hanabi1224 Mar 12, 2026
4c59008
resolve AI comments
hanabi1224 Mar 12, 2026
b26e0c2
resolve comments
hanabi1224 Mar 12, 2026
a758183
resolve comments
hanabi1224 Mar 12, 2026
b7c0d19
fix
hanabi1224 Mar 12, 2026
29dccb6
Merge remote-tracking branch 'origin/main' into hm/head-change-revert
hanabi1224 Mar 12, 2026
20df24c
fix
hanabi1224 Mar 12, 2026
d753d31
fix
hanabi1224 Mar 12, 2026
c6b0c0c
fix
hanabi1224 Mar 12, 2026
843febe
fix
hanabi1224 Mar 12, 2026
4aa7cc5
fix
hanabi1224 Mar 12, 2026
68ae22e
Merge remote-tracking branch 'origin/main' into hm/sqlite-indexer
hanabi1224 Mar 12, 2026
59f9c0b
update filter-list-offline
hanabi1224 Mar 12, 2026
279d588
checks for chain_get_path
hanabi1224 Mar 12, 2026
9865f72
Merge remote-tracking branch 'origin/hm/head-change-revert' into hm/s…
hanabi1224 Mar 13, 2026
93510e1
refactor
hanabi1224 Mar 15, 2026
8997af4
Merge remote-tracking branch 'origin/main' into hm/head-change-revert
hanabi1224 Mar 15, 2026
c6258a6
fix
hanabi1224 Mar 16, 2026
2cfab9e
Merge remote-tracking branch 'origin/main' into hm/sqlite-indexer
hanabi1224 Mar 16, 2026
664ffc5
complete index validation
hanabi1224 Mar 16, 2026
5594a0d
promote get_chain_path failure log level
hanabi1224 Mar 16, 2026
61db9e7
Merge remote-tracking branch 'origin/main' into hm/head-change-revert
hanabi1224 Mar 16, 2026
5945e55
Merge remote-tracking branch 'origin/hm/head-change-revert' into hm/s…
hanabi1224 Mar 16, 2026
ed11d2d
Merge remote-tracking branch 'origin/main' into hm/sqlite-indexer
hanabi1224 Mar 16, 2026
b63a8a5
write lock for sqlite
hanabi1224 Mar 16, 2026
e50ed19
Merge remote-tracking branch 'origin/main' into hm/sqlite-indexer
hanabi1224 Mar 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ smallvec = "1"
smart-default = "0.7"
sonic-rs = "0.5"
spire_enum = "1"
sqlx = { version = "0.8", default-features = false, features = ["sqlite", "runtime-tokio", "macros"] }
stacker = "0.1"
static_assertions = "1"
statrs = "0.18"
Expand Down Expand Up @@ -232,7 +233,6 @@ zstd = "0.13"

# optional dependencies
console-subscriber = { version = "0.5", features = ["parking_lot"], optional = true }
sqlx = { version = "0.8", default-features = false, features = ["sqlite", "runtime-tokio", "macros"], optional = true }
tikv-jemallocator = { version = "0.6", optional = true }
tracing-loki = { version = "0.2", default-features = false, features = ["compat-0-2-1", "rustls"], optional = true }

Expand Down Expand Up @@ -324,14 +324,13 @@ lto = "fat"

# These should be refactored (probably removed) in #2984
[features]
default = ["jemalloc", "tracing-loki", "sqlite"]
test = [] # default feature set for unit tests
default = ["jemalloc", "tracing-loki"]
test = [] # default feature set for unit tests
slim = ["rustalloc"]
cargo-test = [] # group of tests that is recommended to run with `cargo test` instead of `nextest`
doctest-private = [] # see lib.rs::doctest_private
benchmark-private = ["dep:criterion"] # see lib.rs::benchmark_private
interop-tests-private = [] # see lib.rs::interop_tests_private
sqlite = ["dep:sqlx"]
cargo-test = [] # group of tests that is recommended to run with `cargo test` instead of `nextest`
doctest-private = [] # see lib.rs::doctest_private
benchmark-private = ["dep:criterion"] # see lib.rs::benchmark_private
interop-tests-private = [] # see lib.rs::interop_tests_private

# Allocator. Use at most one of these.
rustalloc = []
Expand Down
6 changes: 5 additions & 1 deletion scripts/tests/api_compare/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:
--halt-after-import

SNAPSHOT_EPOCH="$(ls /data/*.car.zst | tail -n 1 | grep -Eo '[0-9]+' | tail -n 1)"
# backfill the index db
# backfill the index db (nosql)
forest-tool index backfill --from $$SNAPSHOT_EPOCH --n-tipsets 200 --chain ${CHAIN}

forest --chain ${CHAIN} --encrypt-keystore false --no-gc \
Expand Down Expand Up @@ -90,6 +90,10 @@ services:
export FULLNODE_API_INFO="$(cat /data/forest-token):/dns/forest/tcp/${FOREST_RPC_PORT}/http"
echo "Waiting till Forest is ready"
forest-cli healthcheck ready --healthcheck-port ${FOREST_HEALTHZ_RPC_PORT} --wait

# backfill the index db (sql)
SNAPSHOT_EPOCH="$(ls /data/*.car.zst | tail -n 1 | grep -Eo '[0-9]+' | tail -n 1)"
forest-cli index validate-backfill --from $$SNAPSHOT_EPOCH --to $(($$SNAPSHOT_EPOCH - 200))
forest-wallet-import:
depends_on:
forest:
Expand Down
1 change: 1 addition & 0 deletions scripts/tests/api_compare/filter-list-gateway
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
!Filecoin.ChainSetHead
!Filecoin.ChainStatObj
!Filecoin.ChainTipSetWeight
!Filecoin.ChainValidateIndex
!Filecoin.EthGetBlockReceiptsLimited
!Filecoin.F3
!Filecoin.GasEstimateGasLimit
Expand Down
2 changes: 2 additions & 0 deletions scripts/tests/api_compare/filter-list-offline
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# This list contains potentially broken methods (or tests) that are ignored.
# They should be considered bugged, and not used until the root cause is resolved.
# Indexer disabled
!Filecoin.ChainValidateIndex
!Filecoin.EthSyncing
!eth_syncing
!Filecoin.NetAddrsListen
Expand Down
4 changes: 2 additions & 2 deletions src/chain/store/chain_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ where
chain_config: Arc<ChainConfig>,
genesis_block_header: CachingBlockHeader,
) -> anyhow::Result<Self> {
let (publisher, _) = broadcast::channel(SINK_CAP);
let (head_changes_tx, _) = broadcast::channel(SINK_CAP);
let chain_index = Arc::new(ChainIndex::new(Arc::clone(&db)));
let validated_blocks = Mutex::new(HashSet::default());
let head = if let Some(head_tsk) = heaviest_tipset_key_provider
Expand All @@ -141,7 +141,7 @@ where
Tipset::from(&genesis_block_header)
};
let cs = Self {
head_changes_tx: publisher,
head_changes_tx,
chain_index,
tipset_tracker: TipsetTracker::new(Arc::clone(&db), chain_config.clone()),
db,
Expand Down
Loading
Loading