Skip to content

Commit c6cb4ee

Browse files
authored
Merge pull request #1185 from lidofinance/fix/integration-tests
fix: failing integration tests
2 parents 22cab0f + bf4f48b commit c6cb4ee

File tree

5 files changed

+54
-56
lines changed

5 files changed

+54
-56
lines changed

contracts/upgrade/TWVoteScript.sol

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,24 @@ contract TWVoteScript is OmnibusBase {
7070
address node_operators_registry_impl;
7171
address oracle_daemon_config;
7272
address nor_app_repo;
73+
address sdvt_app_repo;
7374
// Other parameters
7475
bytes32 node_operators_registry_app_id;
76+
bytes32 sdvt_app_id;
7577
uint16[3] nor_version;
78+
uint16[3] sdvt_version;
7679
uint256 vebo_consensus_version;
7780
uint256 ao_consensus_version;
7881
uint256 nor_exit_deadline_in_sec;
7982
uint256 exit_events_lookback_window_in_slots;
8083
bytes nor_content_uri;
84+
bytes sdvt_content_uri;
8185
}
8286

8387
//
8488
// Constants
8589
//
86-
uint256 public constant VOTE_ITEMS_COUNT = 20;
90+
uint256 public constant VOTE_ITEMS_COUNT = 22;
8791

8892
//
8993
// Structured storage
@@ -336,6 +340,32 @@ contract TWVoteScript is OmnibusBase {
336340
)
337341
});
338342

343+
// 23. Publish new NodeOperatorsRegistry implementation in SimpleDVT app APM repo
344+
voteItems[index++] = VoteItem({
345+
description: "23. Publish new NodeOperatorsRegistry implementation in SimpleDVT app APM repo",
346+
call: _votingCall(
347+
params.sdvt_app_repo,
348+
abi.encodeCall(
349+
IRepo.newVersion,
350+
(params.sdvt_version, params.node_operators_registry_impl, params.nor_content_uri)
351+
)
352+
)
353+
});
354+
355+
// 24. Update SimpleDVT implementation
356+
voteItems[index++] = VoteItem({
357+
description: "24. Update SimpleDVT implementation",
358+
call: _votingCall(
359+
0xb8FFC3Cd6e7Cf5a098A1c92F48009765B24088Dc,
360+
abi.encodeWithSignature(
361+
"setApp(bytes32,bytes32,address)",
362+
IKernel(0xb8FFC3Cd6e7Cf5a098A1c92F48009765B24088Dc).APP_BASES_NAMESPACE(),
363+
params.sdvt_app_id,
364+
params.node_operators_registry_impl
365+
)
366+
)
367+
});
368+
339369
assert(index == VOTE_ITEMS_COUNT);
340370
}
341371

lib/protocol/helpers/accounting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ const simulateReport = async (
367367
withdrawalFinalizationBatches: [],
368368
};
369369
const update = await accounting.simulateOracleReport(reportValues, withdrawalShareRate);
370-
const [postTotalPooledEther, postTotalShares, withdrawals, elRewards] = update;
370+
const { postTotalPooledEther, postTotalShares, withdrawals, elRewards } = update;
371371

372372
log.debug("Simulation result", {
373373
"Post Total Pooled Ether": formatEther(postTotalPooledEther),

scripts/upgrade/steps/0150-deploy-tw-upgrading-contracts.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,19 @@ export async function main() {
3333
node_operators_registry_impl: state[Sk.appNodeOperatorsRegistry].implementation.address,
3434
oracle_daemon_config: await locator.oracleDaemonConfig(),
3535
nor_app_repo: state[Sk.aragonNodeOperatorsRegistryAppRepo].proxy.address,
36+
sdvt_app_repo: state[Sk.aragonSimpleDvtAppRepo].proxy.address,
3637

3738
// Other parameters
3839
node_operators_registry_app_id: state[Sk.appNodeOperatorsRegistry].aragonApp.id,
40+
sdvt_app_id: state[Sk.appSimpleDvt].aragonApp.id,
3941
nor_version: [6, 0, 0],
42+
sdvt_version: [3, 0, 0],
4043
vebo_consensus_version: 4,
4144
ao_consensus_version: 4,
4245
nor_exit_deadline_in_sec: 30 * 60, // 30 minutes
4346
exit_events_lookback_window_in_slots: 7200,
4447
nor_content_uri: state[Sk.appNodeOperatorsRegistry].aragonApp.contentURI,
48+
sdvt_content_uri: state[Sk.appSimpleDvt].aragonApp.contentURI,
4549
},
4650
]);
4751
}

test/integration/core/accounting-oracle-extra-data-full-items.integration.ts

Lines changed: 17 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class ListKeyMapHelper<ValueType> {
6262
}
6363
}
6464

65-
// TODO: update this test for the version with the triggerable exits (no stuck items)
66-
describe.skip("Integration: AccountingOracle extra data full items", () => {
65+
// TODO: remove everything related to stuck validators?
66+
describe("Integration: AccountingOracle extra data full items", () => {
6767
let ctx: ProtocolContext;
6868
let stranger: HardhatEthersSigner;
6969

@@ -143,18 +143,12 @@ describe.skip("Integration: AccountingOracle extra data full items", () => {
143143
}
144144

145145
function testReportingModuleWithMaxExtraDataItems({
146-
norStuckItems,
147146
norExitedItems,
148-
sdvtStuckItems,
149147
sdvtExitedItems,
150-
csmStuckItems,
151148
csmExitedItems,
152149
}: {
153-
norStuckItems: number;
154150
norExitedItems: number;
155-
sdvtStuckItems: number;
156151
sdvtExitedItems: number;
157-
csmStuckItems: number;
158152
csmExitedItems: number;
159153
}) {
160154
return async () => {
@@ -199,35 +193,17 @@ describe.skip("Integration: AccountingOracle extra data full items", () => {
199193
const idsStuck = new Map<bigint, bigint[]>();
200194

201195
idsExited.set(NOR_MODULE_ID, norIds.slice(0, norExitedItems * maxNodeOperatorsPerExtraDataItem));
202-
idsStuck.set(NOR_MODULE_ID, norIds.slice(0, norStuckItems * maxNodeOperatorsPerExtraDataItem));
203196

204197
idsExited.set(SDVT_MODULE_ID, sdvtIds.slice(0, sdvtExitedItems * maxNodeOperatorsPerExtraDataItem));
205-
idsStuck.set(SDVT_MODULE_ID, sdvtIds.slice(0, sdvtStuckItems * maxNodeOperatorsPerExtraDataItem));
206198

207199
if (ctx.flags.withCSM) {
208200
idsExited.set(CSM_MODULE_ID, csmIds.slice(0, csmExitedItems * maxNodeOperatorsPerExtraDataItem));
209-
idsStuck.set(CSM_MODULE_ID, csmIds.slice(0, csmStuckItems * maxNodeOperatorsPerExtraDataItem));
210201
}
211202

212203
const numKeysReportedByNo = new ListKeyMapHelper<bigint>(); // [moduleId, nodeOpId, type] -> numKeys
213204

214205
const reportExtraItems: ItemType[] = [];
215206

216-
for (const { moduleId, module } of modules) {
217-
const ids = idsStuck.get(moduleId)!;
218-
for (const id of ids) {
219-
const summary = await module.getNodeOperatorSummary(id);
220-
const numKeys = summary.stuckValidatorsCount + 1n;
221-
numKeysReportedByNo.set([moduleId, id, EXTRA_DATA_TYPE_STUCK_VALIDATORS], numKeys);
222-
reportExtraItems.push({
223-
moduleId: Number(moduleId),
224-
nodeOpIds: [Number(id)],
225-
keysCounts: [Number(numKeys)],
226-
type: EXTRA_DATA_TYPE_STUCK_VALIDATORS,
227-
});
228-
}
229-
}
230-
231207
for (const { moduleId, module } of modules) {
232208
const ids = idsExited.get(moduleId)!;
233209
for (const id of ids) {
@@ -278,7 +254,7 @@ describe.skip("Integration: AccountingOracle extra data full items", () => {
278254
for (const { moduleId, module } of modules) {
279255
if (moduleId === CSM_MODULE_ID) continue;
280256

281-
const ids = idsStuck.get(moduleId)!;
257+
const ids = idsStuck.get(moduleId) ?? [];
282258
for (const id of ids) {
283259
const nodeOperator = await (module as unknown as LoadedContract<NodeOperatorsRegistry>).getNodeOperator(
284260
id,
@@ -325,7 +301,7 @@ describe.skip("Integration: AccountingOracle extra data full items", () => {
325301
}
326302

327303
// Check module stuck validators, penalties and rewards
328-
const moduleIdsStuck = idsStuck.get(moduleId)!;
304+
const moduleIdsStuck = idsStuck.get(moduleId) ?? [];
329305
for (const opId of moduleIdsStuck) {
330306
// Verify stuck validators count matches expected
331307
const operatorSummary = await module.getNodeOperatorSummary(opId);
@@ -392,32 +368,20 @@ describe.skip("Integration: AccountingOracle extra data full items", () => {
392368
};
393369
}
394370

395-
for (const norStuckItems of [0, 1]) {
396-
for (const norExitedItems of [0, 1]) {
397-
for (const sdvtStuckItems of [0, 1]) {
398-
for (const sdvtExitedItems of [0, 1]) {
399-
for (const csmStuckItems of withCSM() ? [0, 1] : [0]) {
400-
for (const csmExitedItems of withCSM() ? [0, 1] : [0]) {
401-
if (
402-
norStuckItems + norExitedItems + sdvtStuckItems + sdvtExitedItems + csmStuckItems + csmExitedItems ===
403-
0
404-
) {
405-
continue;
406-
}
407-
it(
408-
`should process extra data with full items for all modules with norStuckItems=${norStuckItems}, norExitedItems=${norExitedItems}, sdvtStuckItems=${sdvtStuckItems}, sdvtExitedItems=${sdvtExitedItems}, csmStuckItems=${csmStuckItems}, csmExitedItems=${csmExitedItems}`,
409-
testReportingModuleWithMaxExtraDataItems({
410-
norStuckItems,
411-
norExitedItems,
412-
sdvtStuckItems,
413-
sdvtExitedItems,
414-
csmStuckItems,
415-
csmExitedItems,
416-
}),
417-
);
418-
}
419-
}
371+
for (const norExitedItems of [0, 1]) {
372+
for (const sdvtExitedItems of [0, 1]) {
373+
for (const csmExitedItems of withCSM() ? [0, 1] : [0]) {
374+
if (norExitedItems + sdvtExitedItems + csmExitedItems === 0) {
375+
continue;
420376
}
377+
it(
378+
`should process extra data with full items for all modules with norExitedItems=${norExitedItems}, sdvtExitedItems=${sdvtExitedItems}, csmExitedItems=${csmExitedItems}`,
379+
testReportingModuleWithMaxExtraDataItems({
380+
norExitedItems,
381+
sdvtExitedItems,
382+
csmExitedItems,
383+
}),
384+
);
421385
}
422386
}
423387
}

test/integration/core/happy-path.integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ describe("Scenario: Protocol Happy Path", () => {
244244
});
245245
});
246246

247-
it.skip("Should rebase correctly", async () => {
247+
it("Should rebase correctly", async () => {
248248
const { lido, withdrawalQueue, locator, burner, nor, sdvt } = ctx.contracts;
249249

250250
const treasuryAddress = await locator.treasury();

0 commit comments

Comments
 (0)