Skip to content

Commit

Permalink
Second iteration of mining cache reimplementation.
Browse files Browse the repository at this point in the history
- Reimplement ar_chunk_cache -> ar_mining_cache module
- Rework cache reservation logic
- Rework ar_mining_io workflow
- Rework cache cleanup routines
- Remove cache cycling
  • Loading branch information
shizzard committed Feb 21, 2025
1 parent d3b959c commit 0ecbba9
Show file tree
Hide file tree
Showing 8 changed files with 837 additions and 929 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ jobs:
ar_block,
ar_block_cache,
ar_chain_stats,
ar_chunk_cache,
ar_chunk_copy,
ar_chunk_storage,
ar_data_sync_worker_master,
Expand All @@ -236,6 +235,7 @@ jobs:
ar_join,
ar_kv,
ar_merkle,
ar_mining_cache,
ar_mining_server,
ar_mining_stats,
ar_node,
Expand Down
12 changes: 0 additions & 12 deletions apps/arweave/include/ar_chunk_cache.hrl

This file was deleted.

25 changes: 25 additions & 0 deletions apps/arweave/include/ar_mining_cache.hrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-ifndef(AR_MINING_CACHE_HRL).
-define(AR_MINING_CACHE_HRL, true).

-record(ar_mining_cache_value, {
chunk1 :: binary() | undefined,
chunk2 :: binary() | undefined,
chunk2_missing :: boolean(),
h1 :: binary() | undefined,
h2 :: binary() | undefined
}).

-record(ar_mining_cache_session, {
mining_cache = #{} :: #{term() => #ar_mining_cache_value{}},
mining_cache_size_bytes = 0 :: non_neg_integer(),
reserved_mining_cache_bytes = 0 :: non_neg_integer()
}).


-record(ar_mining_cache, {
mining_cache_sessions = #{} :: #{term() => #ar_mining_cache_session{}},
mining_cache_sessions_queue = queue:new() :: queue:queue(),
mining_cache_limit_bytes = 0 :: non_neg_integer()
}).

-endif.
Loading

0 comments on commit 0ecbba9

Please sign in to comment.