@secondlayer/shared 17.1.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/archive/range-digest.d.ts +2 -65
- package/dist/src/archive/semantic-digest-builder.d.ts +2 -65
- package/dist/src/coverage/index.d.ts +12 -76
- package/dist/src/coverage/index.js +19 -60
- package/dist/src/coverage/index.js.map +3 -3
- package/dist/src/db/index.d.ts +3 -111
- package/dist/src/db/index.js +1 -34
- package/dist/src/db/index.js.map +5 -5
- package/dist/src/db/queries/chain-reorgs.d.ts +2 -65
- package/dist/src/db/queries/chain-reorgs.js +1 -34
- package/dist/src/db/queries/chain-reorgs.js.map +5 -5
- package/dist/src/db/queries/contracts.d.ts +2 -65
- package/dist/src/db/queries/contracts.js.map +2 -2
- package/dist/src/db/queries/instance.d.ts +2 -65
- package/dist/src/db/queries/integrity.d.ts +2 -65
- package/dist/src/db/queries/subgraph-gaps.d.ts +2 -65
- package/dist/src/db/queries/subgraph-operations.d.ts +2 -65
- package/dist/src/db/queries/subgraphs.d.ts +2 -65
- package/dist/src/db/queries/sync-scope.d.ts +2 -65
- package/dist/src/db/queries/webhook-replays.d.ts +2 -65
- package/dist/src/db/queries/webhooks.d.ts +2 -65
- package/dist/src/db/schema.d.ts +3 -64
- package/dist/src/db/schema.js.map +2 -2
- package/dist/src/index.d.ts +3 -111
- package/dist/src/index.js +1 -34
- package/dist/src/index.js.map +5 -5
- package/dist/src/insights/index.d.ts +2 -65
- package/dist/src/leader.js +1 -34
- package/dist/src/leader.js.map +5 -5
- package/dist/src/node/local-client.d.ts +2 -65
- package/dist/src/queue/listener.js +1 -34
- package/dist/src/queue/listener.js.map +5 -5
- package/migrations/0211_decoded_events_slim.ts +114 -0
- package/migrations/0212_events_transactions_redundant_indexes.ts +71 -0
- package/migrations/0213_drop_sbtc_token_events.ts +32 -0
- package/migrations/0214_drop_coverage_receipts.ts +24 -0
- package/migrations/0215_decoder_checkpoints_last_output_at.ts +33 -0
- package/package.json +1 -1
|
@@ -10,8 +10,6 @@ declare const NATIVE_CLOCKS: readonly ["block", "cursor", "queue"];
|
|
|
10
10
|
type NativeClock = (typeof NATIVE_CLOCKS)[number];
|
|
11
11
|
declare const REPAIR_MODES: readonly ["range_safe", "full_reindex", "archive_replay", "none"];
|
|
12
12
|
type RepairMode = (typeof REPAIR_MODES)[number];
|
|
13
|
-
declare const RUN_STATUSES: readonly ["pending", "running", "complete", "syncing", "lagging", "gap", "stale", "failed", "unverified_import", "unanchored", "source_unavailable", "out_of_scope", "disabled", "halted"];
|
|
14
|
-
type RunStatus = (typeof RUN_STATUSES)[number];
|
|
15
13
|
declare const FAILURE_UNITS: readonly ["block", "range", "cursor", "queue"];
|
|
16
14
|
type FailureUnit = (typeof FAILURE_UNITS)[number];
|
|
17
15
|
declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch", "crash", "reorg", "source_gap", "handler", "timeout", "unknown"];
|
|
@@ -452,7 +450,6 @@ interface DecodedEventsTable {
|
|
|
452
450
|
tx_index: number;
|
|
453
451
|
event_index: number;
|
|
454
452
|
event_type: string;
|
|
455
|
-
microblock_hash: string | null;
|
|
456
453
|
canonical: Generated<boolean>;
|
|
457
454
|
contract_id: string | null;
|
|
458
455
|
sender: string | null;
|
|
@@ -464,13 +461,14 @@ interface DecodedEventsTable {
|
|
|
464
461
|
/** Decoded payload for event types that don't fit the flat columns
|
|
465
462
|
* (e.g. `print`: { topic, value, raw_value }). Null for transfer types. */
|
|
466
463
|
payload: unknown | null;
|
|
467
|
-
source_cursor: string;
|
|
468
464
|
created_at: Generated<Date>;
|
|
469
465
|
}
|
|
470
466
|
interface DecoderCheckpointsTable {
|
|
471
467
|
decoder_name: string;
|
|
472
468
|
last_cursor: string | null;
|
|
473
469
|
updated_at: Generated<Date>;
|
|
470
|
+
/** Last commit that wrote output rows; health's real-work signal. */
|
|
471
|
+
last_output_at: Date | null;
|
|
474
472
|
}
|
|
475
473
|
interface ChainReorgsTable {
|
|
476
474
|
id: Generated<string>;
|
|
@@ -598,23 +596,6 @@ interface SbtcEventsTable {
|
|
|
598
596
|
source_cursor: string;
|
|
599
597
|
created_at: Generated<Date>;
|
|
600
598
|
}
|
|
601
|
-
type SbtcTokenEventType = "transfer" | "mint" | "burn";
|
|
602
|
-
interface SbtcTokenEventsTable {
|
|
603
|
-
cursor: string;
|
|
604
|
-
block_height: number;
|
|
605
|
-
block_time: Date;
|
|
606
|
-
tx_id: string;
|
|
607
|
-
tx_index: number;
|
|
608
|
-
event_index: number;
|
|
609
|
-
event_type: SbtcTokenEventType;
|
|
610
|
-
sender: string | null;
|
|
611
|
-
recipient: string | null;
|
|
612
|
-
amount: string;
|
|
613
|
-
memo: string | null;
|
|
614
|
-
canonical: Generated<boolean>;
|
|
615
|
-
source_cursor: string;
|
|
616
|
-
created_at: Generated<Date>;
|
|
617
|
-
}
|
|
618
599
|
/**
|
|
619
600
|
* BTC L1 settlement status for sBTC withdrawal sweeps. Filled by the indexer's
|
|
620
601
|
* settlement-confirmer worker, which polls our own bitcoind for confirmations of
|
|
@@ -796,50 +777,10 @@ interface StageRegistryTable {
|
|
|
796
777
|
enabled: Generated<boolean>;
|
|
797
778
|
created_at: Generated<Date>;
|
|
798
779
|
}
|
|
799
|
-
/** One versioned sweep of a stage. Nothing writes this table yet; kept because the receipts and failures tables reference it. */
|
|
800
|
-
interface StageRunsTable {
|
|
801
|
-
id: Generated<string>;
|
|
802
|
-
stage_id: string;
|
|
803
|
-
code_hash: string;
|
|
804
|
-
config_hash: string;
|
|
805
|
-
handler_hash: string | null;
|
|
806
|
-
target_height: number | null;
|
|
807
|
-
target_cursor: string | null;
|
|
808
|
-
status: RunStatus;
|
|
809
|
-
complete_through: number | null;
|
|
810
|
-
started_at: Generated<Date>;
|
|
811
|
-
finished_at: Date | null;
|
|
812
|
-
}
|
|
813
|
-
/** Per-block acknowledgement. Unique on (stage, height, hash). */
|
|
814
|
-
interface StageBlockReceiptsTable {
|
|
815
|
-
id: Generated<string>;
|
|
816
|
-
stage_id: string;
|
|
817
|
-
run_id: string | null;
|
|
818
|
-
block_height: number;
|
|
819
|
-
block_hash: string;
|
|
820
|
-
input_count: number;
|
|
821
|
-
input_digest: string;
|
|
822
|
-
effect_digest: string;
|
|
823
|
-
finalized: Generated<boolean>;
|
|
824
|
-
compacted_at: Date | null;
|
|
825
|
-
created_at: Generated<Date>;
|
|
826
|
-
}
|
|
827
|
-
/** Compacted finalized range. Only sealed after receipts in the range finalize. */
|
|
828
|
-
interface CoverageSegmentsTable {
|
|
829
|
-
id: Generated<string>;
|
|
830
|
-
stage_id: string;
|
|
831
|
-
from_height: number;
|
|
832
|
-
to_height: number;
|
|
833
|
-
chain_digest: string;
|
|
834
|
-
input_digest: string;
|
|
835
|
-
output_digest: string;
|
|
836
|
-
sealed_at: Generated<Date>;
|
|
837
|
-
}
|
|
838
780
|
/** Exact unit or range that failed, plus retry/retention state. */
|
|
839
781
|
interface StageFailuresTable {
|
|
840
782
|
id: Generated<string>;
|
|
841
783
|
stage_id: string;
|
|
842
|
-
run_id: string | null;
|
|
843
784
|
unit_kind: FailureUnit;
|
|
844
785
|
from_height: number | null;
|
|
845
786
|
to_height: number | null;
|
|
@@ -909,7 +850,6 @@ interface Database {
|
|
|
909
850
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
910
851
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
911
852
|
sbtc_events: SbtcEventsTable;
|
|
912
|
-
sbtc_token_events: SbtcTokenEventsTable;
|
|
913
853
|
sbtc_settlements: SbtcSettlementsTable;
|
|
914
854
|
bns_name_events: BnsNameEventsTable;
|
|
915
855
|
bns_namespace_events: BnsNamespaceEventsTable;
|
|
@@ -922,9 +862,6 @@ interface Database {
|
|
|
922
862
|
observer_journal: ObserverJournalTable;
|
|
923
863
|
sync_scopes: SyncScopesTable;
|
|
924
864
|
stage_registry: StageRegistryTable;
|
|
925
|
-
stage_runs: StageRunsTable;
|
|
926
|
-
stage_block_receipts: StageBlockReceiptsTable;
|
|
927
|
-
coverage_segments: CoverageSegmentsTable;
|
|
928
865
|
stage_failures: StageFailuresTable;
|
|
929
866
|
archive_fetches: ArchiveFetchesTable;
|
|
930
867
|
usage_ledger: UsageLedgerTable;
|
|
@@ -10,8 +10,6 @@ declare const NATIVE_CLOCKS: readonly ["block", "cursor", "queue"];
|
|
|
10
10
|
type NativeClock = (typeof NATIVE_CLOCKS)[number];
|
|
11
11
|
declare const REPAIR_MODES: readonly ["range_safe", "full_reindex", "archive_replay", "none"];
|
|
12
12
|
type RepairMode = (typeof REPAIR_MODES)[number];
|
|
13
|
-
declare const RUN_STATUSES: readonly ["pending", "running", "complete", "syncing", "lagging", "gap", "stale", "failed", "unverified_import", "unanchored", "source_unavailable", "out_of_scope", "disabled", "halted"];
|
|
14
|
-
type RunStatus = (typeof RUN_STATUSES)[number];
|
|
15
13
|
declare const FAILURE_UNITS: readonly ["block", "range", "cursor", "queue"];
|
|
16
14
|
type FailureUnit = (typeof FAILURE_UNITS)[number];
|
|
17
15
|
declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch", "crash", "reorg", "source_gap", "handler", "timeout", "unknown"];
|
|
@@ -452,7 +450,6 @@ interface DecodedEventsTable {
|
|
|
452
450
|
tx_index: number;
|
|
453
451
|
event_index: number;
|
|
454
452
|
event_type: string;
|
|
455
|
-
microblock_hash: string | null;
|
|
456
453
|
canonical: Generated<boolean>;
|
|
457
454
|
contract_id: string | null;
|
|
458
455
|
sender: string | null;
|
|
@@ -464,13 +461,14 @@ interface DecodedEventsTable {
|
|
|
464
461
|
/** Decoded payload for event types that don't fit the flat columns
|
|
465
462
|
* (e.g. `print`: { topic, value, raw_value }). Null for transfer types. */
|
|
466
463
|
payload: unknown | null;
|
|
467
|
-
source_cursor: string;
|
|
468
464
|
created_at: Generated<Date>;
|
|
469
465
|
}
|
|
470
466
|
interface DecoderCheckpointsTable {
|
|
471
467
|
decoder_name: string;
|
|
472
468
|
last_cursor: string | null;
|
|
473
469
|
updated_at: Generated<Date>;
|
|
470
|
+
/** Last commit that wrote output rows; health's real-work signal. */
|
|
471
|
+
last_output_at: Date | null;
|
|
474
472
|
}
|
|
475
473
|
interface ChainReorgsTable {
|
|
476
474
|
id: Generated<string>;
|
|
@@ -598,23 +596,6 @@ interface SbtcEventsTable {
|
|
|
598
596
|
source_cursor: string;
|
|
599
597
|
created_at: Generated<Date>;
|
|
600
598
|
}
|
|
601
|
-
type SbtcTokenEventType = "transfer" | "mint" | "burn";
|
|
602
|
-
interface SbtcTokenEventsTable {
|
|
603
|
-
cursor: string;
|
|
604
|
-
block_height: number;
|
|
605
|
-
block_time: Date;
|
|
606
|
-
tx_id: string;
|
|
607
|
-
tx_index: number;
|
|
608
|
-
event_index: number;
|
|
609
|
-
event_type: SbtcTokenEventType;
|
|
610
|
-
sender: string | null;
|
|
611
|
-
recipient: string | null;
|
|
612
|
-
amount: string;
|
|
613
|
-
memo: string | null;
|
|
614
|
-
canonical: Generated<boolean>;
|
|
615
|
-
source_cursor: string;
|
|
616
|
-
created_at: Generated<Date>;
|
|
617
|
-
}
|
|
618
599
|
/**
|
|
619
600
|
* BTC L1 settlement status for sBTC withdrawal sweeps. Filled by the indexer's
|
|
620
601
|
* settlement-confirmer worker, which polls our own bitcoind for confirmations of
|
|
@@ -796,50 +777,10 @@ interface StageRegistryTable {
|
|
|
796
777
|
enabled: Generated<boolean>;
|
|
797
778
|
created_at: Generated<Date>;
|
|
798
779
|
}
|
|
799
|
-
/** One versioned sweep of a stage. Nothing writes this table yet; kept because the receipts and failures tables reference it. */
|
|
800
|
-
interface StageRunsTable {
|
|
801
|
-
id: Generated<string>;
|
|
802
|
-
stage_id: string;
|
|
803
|
-
code_hash: string;
|
|
804
|
-
config_hash: string;
|
|
805
|
-
handler_hash: string | null;
|
|
806
|
-
target_height: number | null;
|
|
807
|
-
target_cursor: string | null;
|
|
808
|
-
status: RunStatus;
|
|
809
|
-
complete_through: number | null;
|
|
810
|
-
started_at: Generated<Date>;
|
|
811
|
-
finished_at: Date | null;
|
|
812
|
-
}
|
|
813
|
-
/** Per-block acknowledgement. Unique on (stage, height, hash). */
|
|
814
|
-
interface StageBlockReceiptsTable {
|
|
815
|
-
id: Generated<string>;
|
|
816
|
-
stage_id: string;
|
|
817
|
-
run_id: string | null;
|
|
818
|
-
block_height: number;
|
|
819
|
-
block_hash: string;
|
|
820
|
-
input_count: number;
|
|
821
|
-
input_digest: string;
|
|
822
|
-
effect_digest: string;
|
|
823
|
-
finalized: Generated<boolean>;
|
|
824
|
-
compacted_at: Date | null;
|
|
825
|
-
created_at: Generated<Date>;
|
|
826
|
-
}
|
|
827
|
-
/** Compacted finalized range. Only sealed after receipts in the range finalize. */
|
|
828
|
-
interface CoverageSegmentsTable {
|
|
829
|
-
id: Generated<string>;
|
|
830
|
-
stage_id: string;
|
|
831
|
-
from_height: number;
|
|
832
|
-
to_height: number;
|
|
833
|
-
chain_digest: string;
|
|
834
|
-
input_digest: string;
|
|
835
|
-
output_digest: string;
|
|
836
|
-
sealed_at: Generated<Date>;
|
|
837
|
-
}
|
|
838
780
|
/** Exact unit or range that failed, plus retry/retention state. */
|
|
839
781
|
interface StageFailuresTable {
|
|
840
782
|
id: Generated<string>;
|
|
841
783
|
stage_id: string;
|
|
842
|
-
run_id: string | null;
|
|
843
784
|
unit_kind: FailureUnit;
|
|
844
785
|
from_height: number | null;
|
|
845
786
|
to_height: number | null;
|
|
@@ -909,7 +850,6 @@ interface Database {
|
|
|
909
850
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
910
851
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
911
852
|
sbtc_events: SbtcEventsTable;
|
|
912
|
-
sbtc_token_events: SbtcTokenEventsTable;
|
|
913
853
|
sbtc_settlements: SbtcSettlementsTable;
|
|
914
854
|
bns_name_events: BnsNameEventsTable;
|
|
915
855
|
bns_namespace_events: BnsNamespaceEventsTable;
|
|
@@ -922,9 +862,6 @@ interface Database {
|
|
|
922
862
|
observer_journal: ObserverJournalTable;
|
|
923
863
|
sync_scopes: SyncScopesTable;
|
|
924
864
|
stage_registry: StageRegistryTable;
|
|
925
|
-
stage_runs: StageRunsTable;
|
|
926
|
-
stage_block_receipts: StageBlockReceiptsTable;
|
|
927
|
-
coverage_segments: CoverageSegmentsTable;
|
|
928
865
|
stage_failures: StageFailuresTable;
|
|
929
866
|
archive_fetches: ArchiveFetchesTable;
|
|
930
867
|
usage_ledger: UsageLedgerTable;
|
|
@@ -10,8 +10,6 @@ declare const NATIVE_CLOCKS: readonly ["block", "cursor", "queue"];
|
|
|
10
10
|
type NativeClock = (typeof NATIVE_CLOCKS)[number];
|
|
11
11
|
declare const REPAIR_MODES: readonly ["range_safe", "full_reindex", "archive_replay", "none"];
|
|
12
12
|
type RepairMode = (typeof REPAIR_MODES)[number];
|
|
13
|
-
declare const RUN_STATUSES: readonly ["pending", "running", "complete", "syncing", "lagging", "gap", "stale", "failed", "unverified_import", "unanchored", "source_unavailable", "out_of_scope", "disabled", "halted"];
|
|
14
|
-
type RunStatus = (typeof RUN_STATUSES)[number];
|
|
15
13
|
declare const FAILURE_UNITS: readonly ["block", "range", "cursor", "queue"];
|
|
16
14
|
type FailureUnit = (typeof FAILURE_UNITS)[number];
|
|
17
15
|
declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch", "crash", "reorg", "source_gap", "handler", "timeout", "unknown"];
|
|
@@ -452,7 +450,6 @@ interface DecodedEventsTable {
|
|
|
452
450
|
tx_index: number;
|
|
453
451
|
event_index: number;
|
|
454
452
|
event_type: string;
|
|
455
|
-
microblock_hash: string | null;
|
|
456
453
|
canonical: Generated<boolean>;
|
|
457
454
|
contract_id: string | null;
|
|
458
455
|
sender: string | null;
|
|
@@ -464,13 +461,14 @@ interface DecodedEventsTable {
|
|
|
464
461
|
/** Decoded payload for event types that don't fit the flat columns
|
|
465
462
|
* (e.g. `print`: { topic, value, raw_value }). Null for transfer types. */
|
|
466
463
|
payload: unknown | null;
|
|
467
|
-
source_cursor: string;
|
|
468
464
|
created_at: Generated<Date>;
|
|
469
465
|
}
|
|
470
466
|
interface DecoderCheckpointsTable {
|
|
471
467
|
decoder_name: string;
|
|
472
468
|
last_cursor: string | null;
|
|
473
469
|
updated_at: Generated<Date>;
|
|
470
|
+
/** Last commit that wrote output rows; health's real-work signal. */
|
|
471
|
+
last_output_at: Date | null;
|
|
474
472
|
}
|
|
475
473
|
interface ChainReorgsTable {
|
|
476
474
|
id: Generated<string>;
|
|
@@ -598,23 +596,6 @@ interface SbtcEventsTable {
|
|
|
598
596
|
source_cursor: string;
|
|
599
597
|
created_at: Generated<Date>;
|
|
600
598
|
}
|
|
601
|
-
type SbtcTokenEventType = "transfer" | "mint" | "burn";
|
|
602
|
-
interface SbtcTokenEventsTable {
|
|
603
|
-
cursor: string;
|
|
604
|
-
block_height: number;
|
|
605
|
-
block_time: Date;
|
|
606
|
-
tx_id: string;
|
|
607
|
-
tx_index: number;
|
|
608
|
-
event_index: number;
|
|
609
|
-
event_type: SbtcTokenEventType;
|
|
610
|
-
sender: string | null;
|
|
611
|
-
recipient: string | null;
|
|
612
|
-
amount: string;
|
|
613
|
-
memo: string | null;
|
|
614
|
-
canonical: Generated<boolean>;
|
|
615
|
-
source_cursor: string;
|
|
616
|
-
created_at: Generated<Date>;
|
|
617
|
-
}
|
|
618
599
|
/**
|
|
619
600
|
* BTC L1 settlement status for sBTC withdrawal sweeps. Filled by the indexer's
|
|
620
601
|
* settlement-confirmer worker, which polls our own bitcoind for confirmations of
|
|
@@ -796,50 +777,10 @@ interface StageRegistryTable {
|
|
|
796
777
|
enabled: Generated<boolean>;
|
|
797
778
|
created_at: Generated<Date>;
|
|
798
779
|
}
|
|
799
|
-
/** One versioned sweep of a stage. Nothing writes this table yet; kept because the receipts and failures tables reference it. */
|
|
800
|
-
interface StageRunsTable {
|
|
801
|
-
id: Generated<string>;
|
|
802
|
-
stage_id: string;
|
|
803
|
-
code_hash: string;
|
|
804
|
-
config_hash: string;
|
|
805
|
-
handler_hash: string | null;
|
|
806
|
-
target_height: number | null;
|
|
807
|
-
target_cursor: string | null;
|
|
808
|
-
status: RunStatus;
|
|
809
|
-
complete_through: number | null;
|
|
810
|
-
started_at: Generated<Date>;
|
|
811
|
-
finished_at: Date | null;
|
|
812
|
-
}
|
|
813
|
-
/** Per-block acknowledgement. Unique on (stage, height, hash). */
|
|
814
|
-
interface StageBlockReceiptsTable {
|
|
815
|
-
id: Generated<string>;
|
|
816
|
-
stage_id: string;
|
|
817
|
-
run_id: string | null;
|
|
818
|
-
block_height: number;
|
|
819
|
-
block_hash: string;
|
|
820
|
-
input_count: number;
|
|
821
|
-
input_digest: string;
|
|
822
|
-
effect_digest: string;
|
|
823
|
-
finalized: Generated<boolean>;
|
|
824
|
-
compacted_at: Date | null;
|
|
825
|
-
created_at: Generated<Date>;
|
|
826
|
-
}
|
|
827
|
-
/** Compacted finalized range. Only sealed after receipts in the range finalize. */
|
|
828
|
-
interface CoverageSegmentsTable {
|
|
829
|
-
id: Generated<string>;
|
|
830
|
-
stage_id: string;
|
|
831
|
-
from_height: number;
|
|
832
|
-
to_height: number;
|
|
833
|
-
chain_digest: string;
|
|
834
|
-
input_digest: string;
|
|
835
|
-
output_digest: string;
|
|
836
|
-
sealed_at: Generated<Date>;
|
|
837
|
-
}
|
|
838
780
|
/** Exact unit or range that failed, plus retry/retention state. */
|
|
839
781
|
interface StageFailuresTable {
|
|
840
782
|
id: Generated<string>;
|
|
841
783
|
stage_id: string;
|
|
842
|
-
run_id: string | null;
|
|
843
784
|
unit_kind: FailureUnit;
|
|
844
785
|
from_height: number | null;
|
|
845
786
|
to_height: number | null;
|
|
@@ -909,7 +850,6 @@ interface Database {
|
|
|
909
850
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
910
851
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
911
852
|
sbtc_events: SbtcEventsTable;
|
|
912
|
-
sbtc_token_events: SbtcTokenEventsTable;
|
|
913
853
|
sbtc_settlements: SbtcSettlementsTable;
|
|
914
854
|
bns_name_events: BnsNameEventsTable;
|
|
915
855
|
bns_namespace_events: BnsNamespaceEventsTable;
|
|
@@ -922,9 +862,6 @@ interface Database {
|
|
|
922
862
|
observer_journal: ObserverJournalTable;
|
|
923
863
|
sync_scopes: SyncScopesTable;
|
|
924
864
|
stage_registry: StageRegistryTable;
|
|
925
|
-
stage_runs: StageRunsTable;
|
|
926
|
-
stage_block_receipts: StageBlockReceiptsTable;
|
|
927
|
-
coverage_segments: CoverageSegmentsTable;
|
|
928
865
|
stage_failures: StageFailuresTable;
|
|
929
866
|
archive_fetches: ArchiveFetchesTable;
|
|
930
867
|
usage_ledger: UsageLedgerTable;
|
|
@@ -46,8 +46,6 @@ declare const NATIVE_CLOCKS: readonly ["block", "cursor", "queue"];
|
|
|
46
46
|
type NativeClock = (typeof NATIVE_CLOCKS)[number];
|
|
47
47
|
declare const REPAIR_MODES: readonly ["range_safe", "full_reindex", "archive_replay", "none"];
|
|
48
48
|
type RepairMode = (typeof REPAIR_MODES)[number];
|
|
49
|
-
declare const RUN_STATUSES: readonly ["pending", "running", "complete", "syncing", "lagging", "gap", "stale", "failed", "unverified_import", "unanchored", "source_unavailable", "out_of_scope", "disabled", "halted"];
|
|
50
|
-
type RunStatus = (typeof RUN_STATUSES)[number];
|
|
51
49
|
declare const FAILURE_UNITS: readonly ["block", "range", "cursor", "queue"];
|
|
52
50
|
type FailureUnit = (typeof FAILURE_UNITS)[number];
|
|
53
51
|
declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch", "crash", "reorg", "source_gap", "handler", "timeout", "unknown"];
|
|
@@ -463,7 +461,6 @@ interface DecodedEventsTable {
|
|
|
463
461
|
tx_index: number;
|
|
464
462
|
event_index: number;
|
|
465
463
|
event_type: string;
|
|
466
|
-
microblock_hash: string | null;
|
|
467
464
|
canonical: Generated<boolean>;
|
|
468
465
|
contract_id: string | null;
|
|
469
466
|
sender: string | null;
|
|
@@ -475,13 +472,14 @@ interface DecodedEventsTable {
|
|
|
475
472
|
/** Decoded payload for event types that don't fit the flat columns
|
|
476
473
|
* (e.g. `print`: { topic, value, raw_value }). Null for transfer types. */
|
|
477
474
|
payload: unknown | null;
|
|
478
|
-
source_cursor: string;
|
|
479
475
|
created_at: Generated<Date>;
|
|
480
476
|
}
|
|
481
477
|
interface DecoderCheckpointsTable {
|
|
482
478
|
decoder_name: string;
|
|
483
479
|
last_cursor: string | null;
|
|
484
480
|
updated_at: Generated<Date>;
|
|
481
|
+
/** Last commit that wrote output rows; health's real-work signal. */
|
|
482
|
+
last_output_at: Date | null;
|
|
485
483
|
}
|
|
486
484
|
interface ChainReorgsTable {
|
|
487
485
|
id: Generated<string>;
|
|
@@ -609,23 +607,6 @@ interface SbtcEventsTable {
|
|
|
609
607
|
source_cursor: string;
|
|
610
608
|
created_at: Generated<Date>;
|
|
611
609
|
}
|
|
612
|
-
type SbtcTokenEventType = "transfer" | "mint" | "burn";
|
|
613
|
-
interface SbtcTokenEventsTable {
|
|
614
|
-
cursor: string;
|
|
615
|
-
block_height: number;
|
|
616
|
-
block_time: Date;
|
|
617
|
-
tx_id: string;
|
|
618
|
-
tx_index: number;
|
|
619
|
-
event_index: number;
|
|
620
|
-
event_type: SbtcTokenEventType;
|
|
621
|
-
sender: string | null;
|
|
622
|
-
recipient: string | null;
|
|
623
|
-
amount: string;
|
|
624
|
-
memo: string | null;
|
|
625
|
-
canonical: Generated<boolean>;
|
|
626
|
-
source_cursor: string;
|
|
627
|
-
created_at: Generated<Date>;
|
|
628
|
-
}
|
|
629
610
|
/**
|
|
630
611
|
* BTC L1 settlement status for sBTC withdrawal sweeps. Filled by the indexer's
|
|
631
612
|
* settlement-confirmer worker, which polls our own bitcoind for confirmations of
|
|
@@ -807,50 +788,10 @@ interface StageRegistryTable {
|
|
|
807
788
|
enabled: Generated<boolean>;
|
|
808
789
|
created_at: Generated<Date>;
|
|
809
790
|
}
|
|
810
|
-
/** One versioned sweep of a stage. Nothing writes this table yet; kept because the receipts and failures tables reference it. */
|
|
811
|
-
interface StageRunsTable {
|
|
812
|
-
id: Generated<string>;
|
|
813
|
-
stage_id: string;
|
|
814
|
-
code_hash: string;
|
|
815
|
-
config_hash: string;
|
|
816
|
-
handler_hash: string | null;
|
|
817
|
-
target_height: number | null;
|
|
818
|
-
target_cursor: string | null;
|
|
819
|
-
status: RunStatus;
|
|
820
|
-
complete_through: number | null;
|
|
821
|
-
started_at: Generated<Date>;
|
|
822
|
-
finished_at: Date | null;
|
|
823
|
-
}
|
|
824
|
-
/** Per-block acknowledgement. Unique on (stage, height, hash). */
|
|
825
|
-
interface StageBlockReceiptsTable {
|
|
826
|
-
id: Generated<string>;
|
|
827
|
-
stage_id: string;
|
|
828
|
-
run_id: string | null;
|
|
829
|
-
block_height: number;
|
|
830
|
-
block_hash: string;
|
|
831
|
-
input_count: number;
|
|
832
|
-
input_digest: string;
|
|
833
|
-
effect_digest: string;
|
|
834
|
-
finalized: Generated<boolean>;
|
|
835
|
-
compacted_at: Date | null;
|
|
836
|
-
created_at: Generated<Date>;
|
|
837
|
-
}
|
|
838
|
-
/** Compacted finalized range. Only sealed after receipts in the range finalize. */
|
|
839
|
-
interface CoverageSegmentsTable {
|
|
840
|
-
id: Generated<string>;
|
|
841
|
-
stage_id: string;
|
|
842
|
-
from_height: number;
|
|
843
|
-
to_height: number;
|
|
844
|
-
chain_digest: string;
|
|
845
|
-
input_digest: string;
|
|
846
|
-
output_digest: string;
|
|
847
|
-
sealed_at: Generated<Date>;
|
|
848
|
-
}
|
|
849
791
|
/** Exact unit or range that failed, plus retry/retention state. */
|
|
850
792
|
interface StageFailuresTable {
|
|
851
793
|
id: Generated<string>;
|
|
852
794
|
stage_id: string;
|
|
853
|
-
run_id: string | null;
|
|
854
795
|
unit_kind: FailureUnit;
|
|
855
796
|
from_height: number | null;
|
|
856
797
|
to_height: number | null;
|
|
@@ -920,7 +861,6 @@ interface Database {
|
|
|
920
861
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
921
862
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
922
863
|
sbtc_events: SbtcEventsTable;
|
|
923
|
-
sbtc_token_events: SbtcTokenEventsTable;
|
|
924
864
|
sbtc_settlements: SbtcSettlementsTable;
|
|
925
865
|
bns_name_events: BnsNameEventsTable;
|
|
926
866
|
bns_namespace_events: BnsNamespaceEventsTable;
|
|
@@ -933,9 +873,6 @@ interface Database {
|
|
|
933
873
|
observer_journal: ObserverJournalTable;
|
|
934
874
|
sync_scopes: SyncScopesTable;
|
|
935
875
|
stage_registry: StageRegistryTable;
|
|
936
|
-
stage_runs: StageRunsTable;
|
|
937
|
-
stage_block_receipts: StageBlockReceiptsTable;
|
|
938
|
-
coverage_segments: CoverageSegmentsTable;
|
|
939
876
|
stage_failures: StageFailuresTable;
|
|
940
877
|
archive_fetches: ArchiveFetchesTable;
|
|
941
878
|
usage_ledger: UsageLedgerTable;
|
|
@@ -9,8 +9,6 @@ declare const NATIVE_CLOCKS: readonly ["block", "cursor", "queue"];
|
|
|
9
9
|
type NativeClock = (typeof NATIVE_CLOCKS)[number];
|
|
10
10
|
declare const REPAIR_MODES: readonly ["range_safe", "full_reindex", "archive_replay", "none"];
|
|
11
11
|
type RepairMode = (typeof REPAIR_MODES)[number];
|
|
12
|
-
declare const RUN_STATUSES: readonly ["pending", "running", "complete", "syncing", "lagging", "gap", "stale", "failed", "unverified_import", "unanchored", "source_unavailable", "out_of_scope", "disabled", "halted"];
|
|
13
|
-
type RunStatus = (typeof RUN_STATUSES)[number];
|
|
14
12
|
declare const FAILURE_UNITS: readonly ["block", "range", "cursor", "queue"];
|
|
15
13
|
type FailureUnit = (typeof FAILURE_UNITS)[number];
|
|
16
14
|
declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch", "crash", "reorg", "source_gap", "handler", "timeout", "unknown"];
|
|
@@ -462,7 +460,6 @@ interface DecodedEventsTable {
|
|
|
462
460
|
tx_index: number;
|
|
463
461
|
event_index: number;
|
|
464
462
|
event_type: string;
|
|
465
|
-
microblock_hash: string | null;
|
|
466
463
|
canonical: Generated<boolean>;
|
|
467
464
|
contract_id: string | null;
|
|
468
465
|
sender: string | null;
|
|
@@ -474,13 +471,14 @@ interface DecodedEventsTable {
|
|
|
474
471
|
/** Decoded payload for event types that don't fit the flat columns
|
|
475
472
|
* (e.g. `print`: { topic, value, raw_value }). Null for transfer types. */
|
|
476
473
|
payload: unknown | null;
|
|
477
|
-
source_cursor: string;
|
|
478
474
|
created_at: Generated<Date>;
|
|
479
475
|
}
|
|
480
476
|
interface DecoderCheckpointsTable {
|
|
481
477
|
decoder_name: string;
|
|
482
478
|
last_cursor: string | null;
|
|
483
479
|
updated_at: Generated<Date>;
|
|
480
|
+
/** Last commit that wrote output rows; health's real-work signal. */
|
|
481
|
+
last_output_at: Date | null;
|
|
484
482
|
}
|
|
485
483
|
interface ChainReorgsTable {
|
|
486
484
|
id: Generated<string>;
|
|
@@ -608,23 +606,6 @@ interface SbtcEventsTable {
|
|
|
608
606
|
source_cursor: string;
|
|
609
607
|
created_at: Generated<Date>;
|
|
610
608
|
}
|
|
611
|
-
type SbtcTokenEventType = "transfer" | "mint" | "burn";
|
|
612
|
-
interface SbtcTokenEventsTable {
|
|
613
|
-
cursor: string;
|
|
614
|
-
block_height: number;
|
|
615
|
-
block_time: Date;
|
|
616
|
-
tx_id: string;
|
|
617
|
-
tx_index: number;
|
|
618
|
-
event_index: number;
|
|
619
|
-
event_type: SbtcTokenEventType;
|
|
620
|
-
sender: string | null;
|
|
621
|
-
recipient: string | null;
|
|
622
|
-
amount: string;
|
|
623
|
-
memo: string | null;
|
|
624
|
-
canonical: Generated<boolean>;
|
|
625
|
-
source_cursor: string;
|
|
626
|
-
created_at: Generated<Date>;
|
|
627
|
-
}
|
|
628
609
|
/**
|
|
629
610
|
* BTC L1 settlement status for sBTC withdrawal sweeps. Filled by the indexer's
|
|
630
611
|
* settlement-confirmer worker, which polls our own bitcoind for confirmations of
|
|
@@ -806,50 +787,10 @@ interface StageRegistryTable {
|
|
|
806
787
|
enabled: Generated<boolean>;
|
|
807
788
|
created_at: Generated<Date>;
|
|
808
789
|
}
|
|
809
|
-
/** One versioned sweep of a stage. Nothing writes this table yet; kept because the receipts and failures tables reference it. */
|
|
810
|
-
interface StageRunsTable {
|
|
811
|
-
id: Generated<string>;
|
|
812
|
-
stage_id: string;
|
|
813
|
-
code_hash: string;
|
|
814
|
-
config_hash: string;
|
|
815
|
-
handler_hash: string | null;
|
|
816
|
-
target_height: number | null;
|
|
817
|
-
target_cursor: string | null;
|
|
818
|
-
status: RunStatus;
|
|
819
|
-
complete_through: number | null;
|
|
820
|
-
started_at: Generated<Date>;
|
|
821
|
-
finished_at: Date | null;
|
|
822
|
-
}
|
|
823
|
-
/** Per-block acknowledgement. Unique on (stage, height, hash). */
|
|
824
|
-
interface StageBlockReceiptsTable {
|
|
825
|
-
id: Generated<string>;
|
|
826
|
-
stage_id: string;
|
|
827
|
-
run_id: string | null;
|
|
828
|
-
block_height: number;
|
|
829
|
-
block_hash: string;
|
|
830
|
-
input_count: number;
|
|
831
|
-
input_digest: string;
|
|
832
|
-
effect_digest: string;
|
|
833
|
-
finalized: Generated<boolean>;
|
|
834
|
-
compacted_at: Date | null;
|
|
835
|
-
created_at: Generated<Date>;
|
|
836
|
-
}
|
|
837
|
-
/** Compacted finalized range. Only sealed after receipts in the range finalize. */
|
|
838
|
-
interface CoverageSegmentsTable {
|
|
839
|
-
id: Generated<string>;
|
|
840
|
-
stage_id: string;
|
|
841
|
-
from_height: number;
|
|
842
|
-
to_height: number;
|
|
843
|
-
chain_digest: string;
|
|
844
|
-
input_digest: string;
|
|
845
|
-
output_digest: string;
|
|
846
|
-
sealed_at: Generated<Date>;
|
|
847
|
-
}
|
|
848
790
|
/** Exact unit or range that failed, plus retry/retention state. */
|
|
849
791
|
interface StageFailuresTable {
|
|
850
792
|
id: Generated<string>;
|
|
851
793
|
stage_id: string;
|
|
852
|
-
run_id: string | null;
|
|
853
794
|
unit_kind: FailureUnit;
|
|
854
795
|
from_height: number | null;
|
|
855
796
|
to_height: number | null;
|
|
@@ -919,7 +860,6 @@ interface Database {
|
|
|
919
860
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
920
861
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
921
862
|
sbtc_events: SbtcEventsTable;
|
|
922
|
-
sbtc_token_events: SbtcTokenEventsTable;
|
|
923
863
|
sbtc_settlements: SbtcSettlementsTable;
|
|
924
864
|
bns_name_events: BnsNameEventsTable;
|
|
925
865
|
bns_namespace_events: BnsNamespaceEventsTable;
|
|
@@ -932,9 +872,6 @@ interface Database {
|
|
|
932
872
|
observer_journal: ObserverJournalTable;
|
|
933
873
|
sync_scopes: SyncScopesTable;
|
|
934
874
|
stage_registry: StageRegistryTable;
|
|
935
|
-
stage_runs: StageRunsTable;
|
|
936
|
-
stage_block_receipts: StageBlockReceiptsTable;
|
|
937
|
-
coverage_segments: CoverageSegmentsTable;
|
|
938
875
|
stage_failures: StageFailuresTable;
|
|
939
876
|
archive_fetches: ArchiveFetchesTable;
|
|
940
877
|
usage_ledger: UsageLedgerTable;
|