Commit Graph

688 Commits

Author SHA1 Message Date
x
f6cd3fc6e6 research/rlnv2: Add signalling with SMT proofs 2025-10-14 13:22:02 +02:00
x
448d516b2f research/rlnv2: SMT registration 2025-10-07 11:32:57 +02:00
parazyd
9fa1476a0a research/powdata: Implement (de)serialization for MoneroPowData 2025-05-06 19:14:44 +02:00
skoupidi
7656bde63b blockchain: contracts states checksums monotree(smt) added 2025-05-06 16:28:40 +03:00
parazyd
81f37b7b2a chore: Update crate dependencies 2025-05-03 10:35:40 +02:00
parazyd
47f61789c6 research/powdata: Add temporary XMR PowData code to be included in blocks 2025-05-02 13:38:42 +02:00
parazyd
cb58bd5bd9 research: Remove obsolete stateroot code 2025-05-01 15:44:29 +02:00
darkfi
72b7c4e0da research/codes: minor fixes/improvements 2025-05-01 08:07:19 +02:00
skoupidi
c4f3b4eb11 chore: updated sled-overlay to new version 2025-04-25 14:47:40 +03:00
darkfi
5ed8b36310 research: algebraic codes 2025-04-20 10:25:34 +02:00
parazyd
6448058b24 research: Add example sparse Merkle tree for state checksums 2025-04-16 20:22:20 +02:00
darkfi
d27f5dfe4e app: completely rework text editing subsystem. initial draft version 2025-04-15 13:08:42 +02:00
parazyd
8c1b93c607 script/research: Lints 2025-04-15 11:13:56 +02:00
parazyd
c040d9c00f chore: Update crate dependencies 2025-04-15 10:49:43 +02:00
Paul Otten
721502a468 Move from "nightly" toolchain to "stable".
Intended to address tau RefID "Gifn1u".

There are still a few things that require nightly.
- cargo +nightly fmt
- fuzzing
2025-04-14 19:42:15 -04:00
darkfi
19386e4488 research/codes: algebraic codes 2025-04-11 21:11:32 +02:00
skoupidi
197147463a script/research/gg: added a Makefile and use smol instead of async-std 2025-04-04 20:07:40 +03:00
darkfi
af4d31870c speling: cummulative --> cumulative 2025-04-01 13:35:02 +03:00
skoupidi
6c02b4a450 net/message: optional metering infra for rate limitting added 2025-03-06 20:16:41 +02:00
darkfi
c7c551ce8a research/zk: circle-stark.sage 2025-03-02 21:42:33 +01:00
skoupidi
9a9917705f script/research/dam: better flood control 2025-03-01 16:36:25 +02:00
skoupidi
b27dec9b45 net/message: optional max message bytes limit added 2025-02-28 15:03:35 +02:00
parazyd
f5baac83cf chore: Update crate dependencies 2025-02-25 12:15:28 +01:00
skoupidi
c98d728f87 script/research/dam: sleep deprevation detected 2025-02-21 23:23:50 +02:00
skoupidi
4c7fe93cd4 script/research/dam: Denial-of-service Analysis Multitool added 2025-02-21 23:04:43 +02:00
skoupidi
d5b523a38f script/research/rlnd/rlnd: updated to new rpc impl 2025-02-21 16:21:10 +02:00
skoupidi
a671d43cee chore: fmt and fixed minor comments inconsistencies 2025-02-19 13:54:38 +02:00
darkfi
2bbe39e0ee use RpcSettings and RpcSettingsOpt 2025-02-19 13:21:12 +02:00
kalm
f852967618 explorer: move explorer source code from research to bin/explorer for project releases
This commit relocates the explorer code from the research directory to `bin/explorer` to include it as part of future releases.

### Summary of Updates:

#### Darkfi Project
- Updated `Cargo.toml` to include `bin/explorer/explorerd` as a workspace member
- Updated `Cargo.lock` to include the `explorerd` package
- Updated the `Makefile` to include `explorerd` in the build process

#### Explorer Daemon
- Renamed the project directory from `blockchain-explorer` to `explorer`
- Moved the explorer daemon source code to `bin/explorer/explorerd`
- Updated the cargo package name to `explorerd`
- Updated log statement targets from `blockchain-explorer::` to `explorerd::`
- Renamed the explorer configuration file to `explorerd_config.toml`
- Removed Halo2 patches as they are now included in the root package
- Changed default db_path to use explorerd instead of blockchain-explorer in the path
- Changed binary crate Arg structopt name from blockchain-explorer to explorerd

#### Explorer Site
- Moved the explorer site source code to `bin/explorer/site`
- Updated README.md to include new build instructions for explorerd
2025-02-18 03:49:44 -08:00
parazyd
92f0a8a97e research/sss: Fix Cargo.toml 2025-02-18 12:12:29 +01:00
parazyd
34d8671323 research/snowball: Fix code 2025-02-18 12:11:56 +01:00
parazyd
c8636de5ce research/pow: Make the code run again 2025-02-18 11:56:12 +01:00
parazyd
bce531d2ac research/pow: Fix Cargo.toml 2025-02-18 11:45:47 +01:00
parazyd
2f55e8e09d chore: Update RandomX to 1.2.1 2025-02-18 11:11:40 +01:00
kalm
ce5dc4988b explorer: integrate reorg handling with block subscription and subscription sync
This commit integrates blockchain reorg functionality into the explorer’s block syncing and subscriptions, addressing inconsistencies and aligning the explorer state with a Darkfi node. Key improvements include reorg detection and handling in block synchronization and subscriptions, consolidated and refined logging for better observability, state reset methods to reliably handle reorg scenarios, and enhanced safeguards to ensure consistency before starting subscriptions.

Summary of Updates:

## Blocks Module
- Added `get_block_by_height` to retrieve blocks by height to support reorg handling
- Added `reset_to_height` function to reset blocks and related transactions to a specific height, enabling transactional resets. This function was introduced because the blockchain layer's equivalent function could not be reused due to the absence of `StateDiffs` on the explorer side.
- Changed the log level of `reset_blocks` to `debug` to streamline reorg-related logging

## Transaction Module
- Changed the log level of `reset_blocks` to `debug` to streamline reorg-related logging

## Binary Crate (main.rs)
- Added `reset_explorer_state` to reset the explorer state to a given height or to genesis. This ensures consistency across blocks, transactions, and metrics during resets or reorgs
- Updated logging to include transaction count during ExplorerDb initialization

## Rpc Blocks Module
- Refined variable and function names with "darkfid" for improved readability

### Block Sync Reorgs
- Implemented block sync reorg handling to detect and resolve inconsistencies between the Darkfid node and the explorer
- Introduced reorg detection logic based on mismatched block hashes and heights
- Added support for handling reorg scenarios, including genesis related cases
- Extended logging to report detected reorgs and re-alignments
- Updated the `reset` flag handling to purge and resync the explorer state from scratch when enabled
- Added `process_sync_blocks_reorg` to identify mismatched blocks and realign the explorer's blockchain state to the correct height

## Subscription Sync Reorgs
- Added reorg handling in the subscription process to detect reorgs through block height mismatches and reset the explorer state as needed
- Improved safeguards against mismatched last synced and last confirmed blocks before initiating the subscription process

These updates provide explorer nodes the ability to handle blockchain reorgs and ensure alignment with the canonical chain from Darkfi nodes.
2025-02-17 23:03:06 -08:00
kalm
26f69b3e16 explorer/error: added handle_database_error function for reusable error handling
This change introduces a reusable function to format error messages, add target-specific logging context, and encapsulate errors into a `DatabaseError`.
2025-02-17 22:50:04 -08:00
kalm
f9baf96689 explorer/rpc: update logging for darkfid_daemon_request to trace level
Changed the logging level of `darkfid_daemon_request` from `debug` to `trace` to facilitate debugging, particularly during the synchronization of large amounts of blocks.
2025-02-17 22:29:42 -08:00
kalm
2a282d5ff4 explorer/site: Update transaction links on blocks page to use /tx/ path
This commit replaced the transaction link on the blocks page to use the `/tx/` path instead of `/transaction/`. This ensures the transaction URL aligns the updated transaction routing path.
2025-02-17 22:24:32 -08:00
kalm
5fe2593287 explorer/site: display empty metrics instead of "metrics not available" message
This commit updates the explorer UI to show empty metrics when no metrics are available, replacing the previous behavior of displaying a "Gas consumption details are not available" message.
2025-02-17 21:35:50 -08:00
skoupidi
8f59a91e38 contract/money/genesis_mint: impl multiple outputs 2025-02-13 22:12:08 +02:00
camcui
bdfd5e08a8 chore: remove redundant words
Signed-off-by: camcui <cuishua@sina.cn>
2025-02-09 10:35:54 +01:00
parazyd
13620224c0 chore: Update crate dependencies 2025-02-09 10:32:33 +01:00
skoupidi
008a7520c3 script/research/blockchain-explorer: .gitignore updated 2025-02-08 20:59:32 +02:00
skoupidi
53b2993f38 script/research/rlnd: daemon for RLN state management added 2025-02-05 17:43:38 +02:00
parazyd
681a32cefc research/rlnv2: Implement RLN2-DIFF 2025-02-04 21:34:06 +01:00
parazyd
604f443fd1 chore: Update license header year 2025-01-24 10:36:02 +01:00
parazyd
b5d7c52191 chore: Update crate dependencies 2025-01-21 14:21:32 +01:00
kalm
3777279499 explorer: update Makefile to add bundle src contracts target to .PHONY and update clean target
This commit enhances the Makefile by adding the bundle_contracts_src as a phony target and adding clean-up for bundled contract code.

Summary of Updates:
- Added `bundle_contracts_src` to `.PHONY`
- Updated the `clean` target to remove the `native_contracts_src` directory
2025-01-16 09:56:09 -08:00
kalm
c58fd56041 explorer: native contract source code UI
This commit introduces functionality for displaying native contract source code in the DarkFi explorer application, enabling users to view available contracts from the home page, access associated source files, and examine native contract Rust code and zk proofs. This enhancement provides accessibility to native contract information. To support these updates, we have added new pages to the UI, updated styles for rendering source-related pages, and implemented new RPC routes to facilitate contract-related code retrieval.

Additionally, we have restructured the application into Flask blueprints to address the growing complexity of the explorer and adhere to best practices, as app.py was becoming large with diverging functionality. This proactive change prepares us for future expansions, including better organization of graph functionalities. The organization also mirrors the rest of the explorer codebase by maintaining separate pages for contracts, transactions, and blocks, as well as corresponding RPC and service rust modules.

UI Support for Native Contract Source Code

- We have added source code functionality to the UI, Flask blueprints, and RPC routes defined in rpc.py, along with updated styles to effectively render source-related pages.

Style Updates:
- Expanded the color palette for rendering source files.
- Enhanced styles for displaying contract IDs and names in the native contracts table.
- Implemented layout elements for proper display of source code lists and content.
- Added styles for source file list links, including hover effects.

RPC Routes:
- New routes have been added to facilitate requests to the DarkFi daemon for retrieving native contracts, source code paths, and contract source.

UI Enhancements:
- A native contract section has been introduced on the explorer home page to display native contracts.
- A contract source list page allows users to view and click on source code files associated with a native contract.
- A dedicated contract source page renders the source for a specific path associated with a given contract.

Introducing Flask Blueprints

To better manage the growing complexity of the application, we introduced Flask blueprints that organize routes according to their functionality. This restructuring not only enhances readability but also aligns with best practices for Flask applications, facilitating future development.

App.py Updates:
- Routes have been moved to their respective blueprints.

Added Blueprints:
- `__init__.py` file initializes the explorer blueprint package and exposes various blueprints used by the application.
- `block.py` module defines a blueprint for handling block-related functionality.
- `contract.py` module defines a blueprint for managing contract-related functionality.
- explore.py` module manages general functionality related to the home page and search features.
- `transaction.py` module handles transaction-related functionality.

Python Documentation:

- We documented the Python code and updated existing documentation to adhere to Python's best practices for using docstrings, enhancing usability and integration with documentation tools.

Testing:

- Manual testing has been conducted through the UI to verify the functionality of the new RPC methods, ensuring they correctly retrieve and display contract-related information.
2025-01-15 14:21:24 -08:00
kalm
14e38bfa28 explorer: contract RPC module to handle explorerd requests
This commit introduces a new RPC contract module to the Explorerd implementation. The module adds three RPC methods to enhance the functionality of the explorer service:

- `contracts.get_native_contracts`: Retrieves the native contracts deployed in the DarkFi network.

- `contracts.get_contract_source_code_paths`: Fetches the source code paths for a specified contract.

- `contracts.get_contract_source`: Retrieves the source code content for a given contract and source path.

These additions will allow users to retrieve contract-related information more through the RPC interface, enhancing the overall functionality of the explorer.

### Testing
Manual testing has been performed through the UI to verify the correct functionality of the new RPC methods, ensuring they properly retrieve and display contract-related information.

We opted for manual testing because the underlying service and data layer already have reliable unit tests, providing confidence in the core functionality. This approach sufficiently validates the functionality of the new RPC methods within the overall explorer context.
2025-01-15 13:57:03 -08:00