diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 96171c49a..51c7554f9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -84,6 +84,9 @@ jobs: - name: Run bls tests run: | zig build test:bls + - name: Run swap-or-not-shuffle tests + run: | + zig build test:swap_or_not_shuffle - name: Run state-transition tests run: | zig build test:state_transition diff --git a/bindings/napi/shuffle.zig b/bindings/napi/shuffle.zig index 4414a99b9..8769107d7 100644 --- a/bindings/napi/shuffle.zig +++ b/bindings/napi/shuffle.zig @@ -1,5 +1,5 @@ const js = @import("zapi:zapi").js; -const stInnerShuffleList = @import("state_transition").shuffle.innerShuffleList; +const stInnerShuffleList = @import("swap_or_not_shuffle").innerShuffleList; pub fn innerShuffleList(list: js.Uint32Array, seed: js.Uint8Array, rounds: js.Number, forwards: js.Boolean) !void { const list_u32 = try list.toSlice(); diff --git a/build.zig.zon b/build.zig.zon index 1b10a3109..abd55f2e7 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -185,10 +185,14 @@ .root_source_file = "src/bls/root.zig", .imports = .{.blst}, }, + .swap_or_not_shuffle = .{ + .root_source_file = "src/swap_or_not_shuffle/root.zig", + }, .state_transition = .{ .root_source_file = "src/state_transition/root.zig", .imports = .{ .build_options, + .swap_or_not_shuffle, .ssz, .config, .consensus_types, @@ -353,6 +357,7 @@ .bls, .bls_options, .cpu_count, + .swap_or_not_shuffle, .hex, .persistent_merkle_tree, .ssz, @@ -385,6 +390,7 @@ .config = .{ .root_module = .config }, .fork_types = .{ .root_module = .fork_types }, .bls = .{ .root_module = .bls }, + .swap_or_not_shuffle = .{ .root_module = .swap_or_not_shuffle }, .state_transition = .{ .root_module = .state_transition }, .era = .{ .root_module = .era }, .fork_choice = .{ .root_module = .fork_choice }, diff --git a/src/state_transition/root.zig b/src/state_transition/root.zig index de1126b44..a11a55250 100644 --- a/src/state_transition/root.zig +++ b/src/state_transition/root.zig @@ -18,7 +18,6 @@ pub const buildSlashingsCacheFromStateIfNeeded = @import("./cache/slashings_cach pub const EpochCacheImmutableData = @import("./cache/epoch_cache.zig").EpochCacheImmutableData; pub const EpochCache = @import("./cache/epoch_cache.zig").EpochCache; -pub const shuffle = @import("./utils/shuffle.zig"); pub const committee_indices = @import("./utils/committee_indices.zig"); pub const PubkeyCache = @import("./cache/pubkey_cache.zig").PubkeyCache; pub const pkix = @import("./cache/pkix.zig"); diff --git a/src/state_transition/utils/epoch_shuffling.zig b/src/state_transition/utils/epoch_shuffling.zig index 195d15970..c22a4bd50 100644 --- a/src/state_transition/utils/epoch_shuffling.zig +++ b/src/state_transition/utils/epoch_shuffling.zig @@ -6,7 +6,7 @@ const preset = @import("preset").preset; const AnyBeaconState = @import("fork_types").AnyBeaconState; const getSeed = @import("./seed.zig").getSeed; const c = @import("constants"); -const innerShuffleList = @import("./shuffle.zig").innerShuffleList; +const innerShuffleList = @import("swap_or_not_shuffle").innerShuffleList; const Epoch = types.primitive.Epoch.Type; const computeStartSlotAtEpoch = @import("./epoch.zig").computeStartSlotAtEpoch; const getBlockRootAtSlot = @import("./block_root.zig").getBlockRootAtSlot; diff --git a/src/state_transition/utils_test_root.zig b/src/state_transition/utils_test_root.zig index be75e1ffb..14fb382ac 100644 --- a/src/state_transition/utils_test_root.zig +++ b/src/state_transition/utils_test_root.zig @@ -24,7 +24,6 @@ test "state_transition utils" { _ = @import("utils/pubkey_index_map.zig"); _ = @import("utils/ref_count.zig"); _ = @import("utils/seed.zig"); - _ = @import("utils/shuffle.zig"); _ = @import("utils/signature_sets.zig"); _ = @import("utils/signing_root.zig"); _ = @import("utils/sync_committee.zig"); diff --git a/src/state_transition/utils/shuffle.zig b/src/swap_or_not_shuffle/root.zig similarity index 100% rename from src/state_transition/utils/shuffle.zig rename to src/swap_or_not_shuffle/root.zig