Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auditor): dump fetched spends to local disk #1960

Closed
wants to merge 1 commit into from

Conversation

maqi
Copy link
Member

@maqi maqi commented Jul 10, 2024

This pull request primarily introduces changes to the SpendDagDb implementation in the sn_auditor package, specifically in the dag_db.rs and main.rs files. The changes aim to enhance the process of updating the Directed Acyclic Graph (DAG) from the network by storing spends (transactions) on disk for better tracking and auditing. This is achieved by adding a storage_dir parameter to the continuous_background_update method and modifying how spends are processed.

The most important changes are:

  • sn_auditor/src/dag_db.rs: The continuous_background_update method in the SpendDagDb implementation now takes an additional storage_dir: PathBuf parameter. This directory path is used to store spends on disk.
  • sn_auditor/src/dag_db.rs: The spend processing logic has been updated. Now, each spend is hashed and stored in a detected_spends set. If a spend is new (not already in the set), it's written to a file in the storage_dir. The file name is a combination of the spend's address and hash.
  • sn_auditor/src/main.rs: The main function now creates a storage_dir and passes it to the initialize_background_spend_dag_collection function.
  • sn_auditor/src/main.rs: The initialize_background_spend_dag_collection function now takes an additional storage_dir: PathBuf parameter. This is passed to the continuous_background_update method of the SpendDagDb instance. [1] [2]

These changes are important as they help in tracking and auditing transactions by storing them on disk. This makes it easier to inspect individual transactions and provides a persistent record of transactions for auditing purposes.

@maqi
Copy link
Member Author

maqi commented Jul 16, 2024

Replaced by the PR #1973

@maqi maqi closed this Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant