Commit Graph

10 Commits

Author SHA1 Message Date
oars
d85cf80dbf replace log imports with tracing everywhere 2025-11-07 10:15:36 +03:00
skoupidi
464258698d explorer: chore clippy 2025-06-28 17:16:20 +03:00
kalm
15fb9fd8ea explorerd/service/blocks: handle duplicate PoW coin errors after reorgs
This update introduces code to ensure blocks with PoW rewards containing coins already applied to the contract state prior to a reorg are synced. Additionally, it brings awareness to the need for rolling back the contract state to a specific height during reorgs.
2025-05-25 22:51:44 -07:00
kalm
18c2de1ca5 explorerd/service/blocks: fix reset_to_height get_by_range query and enhance debug logging
This fix adjusts the range query in `reset_to_height` to start from `reset_height + 1`, ensuring transactions from `reset_height` are excluded when deleting reset block transactions.

Summary of changes:
- Updated the `get_by_range` query to exclude `reset_height` transactions
- Enhanced debug statements to validate transaction deletions and associated block heights during reorgs
2025-05-25 21:26:15 -07:00
kalm
f03f5977b6 explorerd/service: enhance put_block and calculate_tx_gas_data to apply contract state changes, cleanup
This commit updates the `calculate_tx_gas_data` function to apply state changes during contract execution, enabling contract data availability for subsequent contract calls during block sync. Additionally, `put_block` was modified to apply PoW reward transactions to the WASM runtime, ensuring their effects are visible to transaction runtimes used for fee calculations where applicable.

Minor cleanup was performed.
2025-05-19 00:02:56 -07:00
skoupidi
b054d403de blockchain: proof of work data enum added 2025-05-07 15:01:07 +03:00
skoupidi
be45acd927 chore: fixing my stupidity 2025-05-07 13:38:14 +03:00
skoupidi
7656bde63b blockchain: contracts states checksums monotree(smt) added 2025-05-06 16:28:40 +03:00
kalm
67c43d0b12 explorerd/service: enhance error clarity for invalid header hash parsing
Updates the service layer to map failed `header_hash` parsing to `ExplorerdError::InvalidHeaderHash`. This improves error messages by including the invalid hash value, making them more actionable.
2025-03-24 04:23:30 -07:00
kalm
826b6dbc50 explorerd: folder-based modules for rpc, service, and store
This commit reorganizes the project structure by grouping RPC, service, and store functionalities into dedicated module folders:

- `rpc`: Handles JSON-RPC interactions, migrated from `rpc_*.rs` (e.g., `rpc_transactions.rs` → `rpc/transactions.rs`)
- `service`: structured to contain the core logic for block synchronization, chain data access, metadata storage/retrieval, and statistics computation
- `store`: manages persistent storage for blockchain, contracts, metrics, and metadata

This structural refactor introduces no functional changes.

Benefits:
- Simplifies the crate root
- Groups related functionality into cohesive module boundaries
- Removes need for file prefixes and suffixes (e.g., `rpc_`, `_store`) by relying on folder-based module names for context (e.g., `rpc::blocks`, `store::metrics`)
- Enhances separation of concerns with defined responsibilities across the `rpc`, `service`, and `store` modules
- Implements domain-based boundaries that reflect the system's architecture
- Aims to improve maintainability and readability, particularly for new contributors
2025-03-14 21:07:27 -07:00