Skip to content

chore(cache): move cache system out of config #118

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

Merged
merged 5 commits into from
Jun 24, 2025
Merged

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented Jun 23, 2025

There's no reason for this to be contained here, and feels wrong when every other task has its own file / spawn pattern.

Copy link
Member Author

Evalir commented Jun 23, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

tests/cache.rs Outdated
@@ -10,7 +13,7 @@ async fn test_bundle_poller_roundtrip() -> eyre::Result<()> {
let config = setup_test_config().unwrap();

let (block_env, _jh) = config.env_task().spawn();
let cache = config.spawn_cache_system(block_env);
let cache = CacheSystem::spawn(&config, block_env);
Copy link
Member

Choose a reason for hiding this comment

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

this API doesn't match our idiom. our idiom is to

  • instantiate a struct let my_struct = MyStruct::new(...)
  • call my_struct.spawn()

CacheSystem is not a spawnable task in this way, it;s only a holder for the join handles and a ref to the simcache to ensure it is not prematurely dropped

if you want to make a spawnable CacheTasks then it should be a composition of the 2 component tasks that spawns both of them

struct CacheTask {
    /// The transaction poller task.
    pub tx: TxPoller,

    /// The bundle poller task.
    pub bundle: BundlePoller
}

Copy link
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

NACK on the new api. suggested an improvement that's in our idiom.

@Evalir Evalir changed the base branch from evalir/update-rust-version to graphite-base/118 June 23, 2025 15:49
@Evalir Evalir force-pushed the evalir/move-cache-system branch from d06ffc0 to 6575e67 Compare June 23, 2025 15:49
@Evalir Evalir force-pushed the graphite-base/118 branch from e31d791 to b30b12a Compare June 23, 2025 15:49
@graphite-app graphite-app bot changed the base branch from graphite-base/118 to main June 23, 2025 15:50
@Evalir Evalir force-pushed the evalir/move-cache-system branch from 6575e67 to 7bd7fdd Compare June 23, 2025 15:50
Copy link
Member Author

Evalir commented Jun 23, 2025

Note that this is not a new api—this was just moved from the config file. I'll update to the newly proposed API

@prestwich
Copy link
Member

it's not new logic, it is a new API

Evalir added 2 commits June 23, 2025 18:52
There's no reason for this to be contained here, and feels wrong when every other task has its own file / spawn pattern.
@Evalir Evalir force-pushed the evalir/move-cache-system branch from 7bd7fdd to f506945 Compare June 23, 2025 16:52
@Evalir Evalir requested a review from prestwich June 23, 2025 17:22
@Evalir Evalir requested a review from prestwich June 23, 2025 18:38
@Evalir Evalir merged commit 1d10cb6 into main Jun 24, 2025
6 checks passed
@Evalir Evalir deleted the evalir/move-cache-system branch June 24, 2025 10:26
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.

2 participants