Skip to content

Commit

Permalink
Fix account to shard code to work with last shard
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Feb 12, 2024
1 parent 6219fe6 commit 9982e32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/lake.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ function shardForAccount(accountId) {
// TODO: Don't hardcode this
// NOTE: This needs to match nearcore logic here: https://github.com/near/nearcore/blob/c6afdd71005a0f9b3e57244188ca02b97eeb0395/core/primitives/src/shard_layout.rs#L239
const boundaryAccounts = ["aurora", "aurora-0", "kkuuue2akv_1630967379.near"];
return boundaryAccounts.findIndex(boundaryAccount => accountId < boundaryAccount);
const index = boundaryAccounts.findIndex(boundaryAccount => accountId < boundaryAccount);
return index < 0 ? boundaryAccounts.length : index;
}

async function fileExists(file) {
Expand Down

0 comments on commit 9982e32

Please sign in to comment.