Skip to content

Commit

Permalink
fixup remove ar_randomx_state
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Berman committed Sep 5, 2024
1 parent 168c32d commit 31e7ab1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 266 deletions.
13 changes: 3 additions & 10 deletions apps/arweave/src/ar_http_iface_middleware.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1839,18 +1839,11 @@ handle_get_block(H, Req, Pid, Encoding) ->
end.

handle_get_block2(H, Req, Encoding) ->
ReadB =
case ar_randomx_state:get_key_block(H) of
not_found ->
ar_storage:read_block(H);
{ok, B} ->
B
end,
case ReadB of
case ar_storage:read_block(H) of
unavailable ->
{404, #{}, <<"Block not found.">>, Req};
#block{} ->
handle_get_block3(ReadB, Req, Encoding)
#block{} = B ->
handle_get_block3(B, Req, Encoding)
end.

handle_get_block3(B, Req, Encoding) ->
Expand Down
3 changes: 0 additions & 3 deletions apps/arweave/src/ar_node_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ init([]) ->
%% Trap exit to avoid corrupting any open files on quit.
process_flag(trap_exit, true),
[ok, ok, ok, ok, ok] = ar_events:subscribe([tx, block, nonce_limiter, miner, node_state]),
%% Initialize RandomX.
ar_randomx_state:start(),
ar_randomx_state:start_block_polling(),
%% Read persisted mempool.
ar_mempool:load_from_disk(),
%% Join the network.
Expand Down
251 changes: 0 additions & 251 deletions apps/arweave/src/ar_randomx_state.erl

This file was deleted.

2 changes: 0 additions & 2 deletions apps/arweave/src/ar_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ init([]) ->
ets:new(ar_peers, [set, public, named_table, {read_concurrency, true}]),
ets:new(ar_http, [set, public, named_table]),
ets:new(ar_blacklist_middleware, [set, public, named_table]),
ets:new(ar_randomx_state_key_blocks, [set, public, named_table]),
ets:new(ar_randomx_state_key_heights, [ordered_set, public, named_table]),
ets:new(blacklist, [set, public, named_table]),
ets:new(ignored_ids, [bag, public, named_table]),
ets:new(ar_tx_emitter_recently_emitted, [set, public, named_table]),
Expand Down

0 comments on commit 31e7ab1

Please sign in to comment.