Skip to content

Commit 0b59556

Browse files
committed
excluding excluding
1 parent b1b515d commit 0b59556

File tree

3 files changed

+70
-9
lines changed

3 files changed

+70
-9
lines changed

tooling/sparta/src/commands/getAdminInfo.ts

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,57 @@ import {
77
import { ChainInfoService } from "../services/chaininfo-service.js";
88
import { paginate } from "../utils/pagination.js";
99

10+
export const EXCLUDED_VALIDATORS = [
11+
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
12+
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
13+
"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
14+
"0x90F79bf6EB2c4f870365E785982E1f101E93b906",
15+
"0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65",
16+
"0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
17+
"0x976EA74026E726554dB657fA54763abd0C3a0aa9",
18+
"0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
19+
"0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
20+
"0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
21+
"0xBcd4042DE499D14e55001CcbB24a551F3b954096",
22+
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
23+
"0xFABB0ac9d68B0B445fB7357272Ff202C5651694a",
24+
"0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec",
25+
"0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097",
26+
"0xcd3B766CCDd6AE721141F452C550Ca635964ce71",
27+
"0x2546BcD3c84621e976D8185a91A922aE77ECEc30",
28+
"0xbDA5747bFD65F08deb54cb465eB87D40e51B197E",
29+
"0xdD2FD4581271e230360230F9337D5c0430Bf44C0",
30+
"0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199",
31+
"0x09DB0a93B389bEF724429898f539AEB7ac2Dd55f",
32+
"0x02484cb50AAC86Eae85610D6f4Bf026f30f6627D",
33+
"0x08135Da0A343E492FA2d4282F2AE34c6c5CC1BbE",
34+
"0x5E661B79FE2D3F6cE70F5AAC07d8Cd9abb2743F1",
35+
"0x61097BA76cD906d2ba4FD106E757f7Eb455fc295",
36+
"0xDf37F81dAAD2b0327A0A50003740e1C935C70913",
37+
"0x553BC17A05702530097c3677091C5BB47a3a7931",
38+
"0x87BdCE72c06C21cd96219BD8521bDF1F42C78b5e",
39+
"0x40Fc963A729c542424cD800349a7E4Ecc4896624",
40+
"0x9DCCe783B6464611f38631e6C851bf441907c710",
41+
"0x1BcB8e569EedAb4668e55145Cfeaf190902d3CF2",
42+
"0x8263Fce86B1b78F95Ab4dae11907d8AF88f841e7",
43+
"0xcF2d5b3cBb4D7bF04e3F7bFa8e27081B52191f91",
44+
"0x86c53Eb85D0B7548fea5C4B4F82b4205C8f6Ac18",
45+
"0x1aac82773CB722166D7dA0d5b0FA35B0307dD99D",
46+
"0x2f4f06d218E426344CFE1A83D53dAd806994D325",
47+
"0x1003ff39d25F2Ab16dBCc18EcE05a9B6154f65F4",
48+
"0x9eAF5590f2c84912A08de97FA28d0529361Deb9E",
49+
"0x11e8F3eA3C6FcF12EcfF2722d75CEFC539c51a1C",
50+
"0x7D86687F980A56b832e9378952B738b614A99dc6",
51+
"0x9eF6c02FB2ECc446146E05F1fF687a788a8BF76d",
52+
"0x08A2DE6F3528319123b25935C92888B16db8913E",
53+
"0xe141C82D99D85098e03E1a1cC1CdE676556fDdE0",
54+
"0x4b23D303D9e3719D6CDf8d172Ea030F80509ea15",
55+
"0xC004e69C5C04A223463Ff32042dd36DabF63A25a",
56+
"0x5eb15C0992734B5e77c888D713b4FC67b3D679A2",
57+
"0x7Ebb637fd68c523613bE51aad27C35C4DB199B9c",
58+
"0x3c3E2E178C69D4baD964568415a0f0c84fd6320A",
59+
];
60+
1061
export default {
1162
data: new SlashCommandBuilder()
1263
.setName("admin-info")
@@ -32,16 +83,25 @@ export default {
3283
const addressesPerPage = 40;
3384

3485
const { validators, committee } = await ChainInfoService.getInfo();
86+
const filteredValidators = (validators as string[]).filter(
87+
(v) => !EXCLUDED_VALIDATORS.includes(v)
88+
);
89+
const filteredCommittee = (committee as string[]).filter(
90+
(v) => !EXCLUDED_VALIDATORS.includes(v)
91+
);
92+
3593
if (interaction.options.getSubcommand() === "committee") {
3694
await paginate(
37-
committee as string[],
95+
filteredCommittee,
96+
committee.length,
3897
addressesPerPage,
3998
interaction,
4099
"Committee"
41100
);
42101
} else if (interaction.options.getSubcommand() === "validators") {
43102
await paginate(
44-
validators as string[],
103+
filteredValidators,
104+
validators.length,
45105
addressesPerPage,
46106
interaction,
47107
"Validators"

tooling/sparta/src/services/chaininfo-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
ETHEREUM_CHAIN_ID,
77
} from "../env.js";
88

9-
type ChainInfo<> = {
9+
type ChainInfo = {
1010
pendingBlockNum: string;
1111
provenBlockNum: string;
1212
validators: string | string[];

tooling/sparta/src/utils/pagination.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ChatInputCommandInteraction } from "discord.js";
44

55
export const paginate = async (
66
array: string[],
7+
total: number,
78
perMessage: number,
89
interaction: ChatInputCommandInteraction,
910
message: string
@@ -17,15 +18,15 @@ export const paginate = async (
1718

1819
if (i === 0) {
1920
await interaction.editReply({
20-
content: `${message} (${start + 1}-${end} of ${
21-
array.length
22-
}):\n${validatorSlice.join("\n")}`,
21+
content: `${message} total: ${total}.\n${message} (excl. Aztec Labs) (${
22+
start + 1
23+
}-${end} of ${array.length}):\n${validatorSlice.join("\n")}`,
2324
});
2425
} else {
2526
await interaction.followUp({
26-
content: `${message} (${start + 1}-${end} of ${
27-
array.length
28-
}):\n${validatorSlice.join("\n")}`,
27+
content: `${message} total: ${total}.\n${message} (excl. Aztec Labs) (${
28+
start + 1
29+
}-${end} of ${array.length}):\n${validatorSlice.join("\n")}`,
2930
flags: MessageFlags.Ephemeral,
3031
});
3132
}

0 commit comments

Comments
 (0)