@@ -4,7 +4,7 @@ pub const PubkeyIndexMap = @import("pubkey_index_map.zig").PubkeyIndexMap;
44const PUBKEY_INDEX_MAP_KEY_SIZE = @import ("pubkey_index_map.zig" ).PUBKEY_INDEX_MAP_KEY_SIZE ;
55const innerShuffleList = @import ("shuffle.zig" ).innerShuffleList ;
66const SEED_SIZE = @import ("shuffle.zig" ).SEED_SIZE ;
7- const compute_indices = @import ("compute_indices .zig" );
7+ const committee_indices = @import ("committee_indices .zig" );
88const ErrorCode = @import ("error.zig" ).ErrorCode ;
99const NOT_FOUND_INDEX = @import ("error.zig" ).NOT_FOUND_INDEX ;
1010const ERROR_INDEX = @import ("error.zig" ).ERROR_INDEX ;
@@ -264,26 +264,26 @@ export fn doShuffleList(active_indices: [*c]u32, len: usize, seed: [*c]u8, seed_
264264export fn computeProposerIndexElectra (seed : [* c ]u8 , seed_len : usize , active_indices : [* c ]u32 , active_indices_len : usize , effective_balance_increments : [* c ]u16 , effective_balance_increments_len : usize , max_effective_balance_electra : u64 , effective_balance_increment : u32 , rounds : u32 ) u32 {
265265 const allocator = gpa .allocator ();
266266 // TODO: is it better to define a Result struct with code and value
267- const proposer_index = compute_indices .computeProposerIndexElectra (allocator , seed [0.. seed_len ], active_indices [0.. active_indices_len ], effective_balance_increments [0.. effective_balance_increments_len ], max_effective_balance_electra , effective_balance_increment , rounds ) catch return ERROR_INDEX ;
267+ const proposer_index = committee_indices .computeProposerIndexElectra (allocator , seed [0.. seed_len ], active_indices [0.. active_indices_len ], effective_balance_increments [0.. effective_balance_increments_len ], max_effective_balance_electra , effective_balance_increment , rounds ) catch return ERROR_INDEX ;
268268 return proposer_index ;
269269}
270270
271- export fn computeProposerIndex (seed : [* c ]u8 , seed_len : usize , active_indices : [* c ]u32 , active_indices_len : usize , effective_balance_increments : [* c ]u16 , effective_balance_increments_len : usize , rand_byte_count : compute_indices .ByteCount , max_effective_balance : u64 , effective_balance_increment : u32 , rounds : u32 ) u32 {
271+ export fn computeProposerIndex (seed : [* c ]u8 , seed_len : usize , active_indices : [* c ]u32 , active_indices_len : usize , effective_balance_increments : [* c ]u16 , effective_balance_increments_len : usize , rand_byte_count : committee_indices .ByteCount , max_effective_balance : u64 , effective_balance_increment : u32 , rounds : u32 ) u32 {
272272 const allocator = gpa .allocator ();
273273 // TODO: is it better to define a Result struct with code and value
274- const proposer_index = compute_indices .computeProposerIndex (allocator , seed [0.. seed_len ], active_indices [0.. active_indices_len ], effective_balance_increments [0.. effective_balance_increments_len ], rand_byte_count , max_effective_balance , effective_balance_increment , rounds ) catch return ERROR_INDEX ;
274+ const proposer_index = committee_indices .computeProposerIndex (allocator , seed [0.. seed_len ], active_indices [0.. active_indices_len ], effective_balance_increments [0.. effective_balance_increments_len ], rand_byte_count , max_effective_balance , effective_balance_increment , rounds ) catch return ERROR_INDEX ;
275275 return proposer_index ;
276276}
277277
278278export fn computeSyncCommitteeIndicesElectra (seed : [* c ]u8 , seed_len : usize , active_indices : [* c ]u32 , active_indices_len : usize , effective_balance_increments : [* c ]u16 , effective_balance_increments_len : usize , max_effective_balance_electra : u64 , effective_balance_increment : u32 , rounds : u32 , out : [* c ]u32 , out_len : usize ) c_uint {
279279 const allocator = gpa .allocator ();
280- compute_indices .computeSyncCommitteeIndicesElectra (allocator , seed [0.. seed_len ], active_indices [0.. active_indices_len ], effective_balance_increments [0.. effective_balance_increments_len ], max_effective_balance_electra , effective_balance_increment , rounds , out [0.. out_len ]) catch return ErrorCode .Error ;
280+ committee_indices .computeSyncCommitteeIndicesElectra (allocator , seed [0.. seed_len ], active_indices [0.. active_indices_len ], effective_balance_increments [0.. effective_balance_increments_len ], max_effective_balance_electra , effective_balance_increment , rounds , out [0.. out_len ]) catch return ErrorCode .Error ;
281281 return ErrorCode .Success ;
282282}
283283
284- export fn computeSyncCommitteeIndices (seed : [* c ]u8 , seed_len : usize , active_indices : [* c ]u32 , active_indices_len : usize , effective_balance_increments : [* c ]u16 , effective_balance_increments_len : usize , rand_byte_count : compute_indices .ByteCount , max_effective_balance : u64 , effective_balance_increment : u32 , rounds : u32 , out : [* c ]u32 , out_len : usize ) c_uint {
284+ export fn computeSyncCommitteeIndices (seed : [* c ]u8 , seed_len : usize , active_indices : [* c ]u32 , active_indices_len : usize , effective_balance_increments : [* c ]u16 , effective_balance_increments_len : usize , rand_byte_count : committee_indices .ByteCount , max_effective_balance : u64 , effective_balance_increment : u32 , rounds : u32 , out : [* c ]u32 , out_len : usize ) c_uint {
285285 const allocator = gpa .allocator ();
286- compute_indices .computeSyncCommitteeIndices (allocator , seed [0.. seed_len ], active_indices [0.. active_indices_len ], effective_balance_increments [0.. effective_balance_increments_len ], rand_byte_count , max_effective_balance , effective_balance_increment , rounds , out [0.. out_len ]) catch return ErrorCode .Error ;
286+ committee_indices .computeSyncCommitteeIndices (allocator , seed [0.. seed_len ], active_indices [0.. active_indices_len ], effective_balance_increments [0.. effective_balance_increments_len ], rand_byte_count , max_effective_balance , effective_balance_increment , rounds , out [0.. out_len ]) catch return ErrorCode .Error ;
287287 return ErrorCode .Success ;
288288}
289289
0 commit comments