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: add state pruner #161

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open

feat: add state pruner #161

wants to merge 84 commits into from

Conversation

hal3e
Copy link
Contributor

@hal3e hal3e commented Nov 22, 2024

Adds the state_pruner service which will delete entries older that a certain retention duration from the db.

Additional refactoring done in this PR:

  • the old ports scheme was removed in favor of having each service declare its own ports and the adapters implementing them.
  • adapters moved to adapters folder
  • added test-helpers crate
  • moved service tests to integration tests

@hal3e hal3e added the bug Something isn't working label Nov 22, 2024
@hal3e hal3e self-assigned this Nov 22, 2024
@hal3e hal3e added big and removed bug Something isn't working labels Nov 22, 2024
@@ -21,7 +23,7 @@ pub async fn launch_api_server(
config: &Config,
internal_config: &Internal,
metrics_registry: Registry,
storage: impl Storage + 'static + Clone,
storage: impl services::status_reporter::port::Storage + Clone + 'static,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should be a driving/incoming port. But we're probably not going to do that now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to do this in another PR.

@@ -140,8 +146,11 @@ pub fn block_importer(
cancel_token: CancellationToken,
config: &config::Config,
) -> tokio::task::JoinHandle<()> {
let block_importer =
services::BlockImporter::new(storage, fuel, config.app.bundle.block_height_lookback);
let block_importer = services::block_importer::service::BlockImporter::new(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't seen all of the code yet, would it be cleaner if you reexported this so the use path here is services::BlockImporter?

e2e/src/lib.rs Outdated Show resolved Hide resolved
packages/adapters/clock/src/lib.rs Outdated Show resolved Hide resolved
packages/adapters/storage/src/postgres.rs Outdated Show resolved Hide resolved
packages/adapters/storage/src/postgres.rs Show resolved Hide resolved
packages/services/src/state_pruner.rs Outdated Show resolved Hide resolved
packages/services/tests/state_pruner.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants