mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-01-07 16:33:10 +00:00
fix: remove offchain lazy erase test - rate limit still applies
This commit is contained in:
parent
842e0f1a89
commit
3bce55abc4
@ -1635,31 +1635,6 @@ contract WakuRlnV2Test is Test {
|
||||
return current == root;
|
||||
}
|
||||
|
||||
function test_OffChainProofPostLazyErase() external {
|
||||
uint32 rateLimit = w.minMembershipRateLimit();
|
||||
(, uint256 price) = w.priceCalculator().calculate(rateLimit);
|
||||
token.approve(address(w), price);
|
||||
w.register(1, rateLimit, new uint256[](0));
|
||||
uint256 rootPre = w.root();
|
||||
uint256[20] memory proofPre = w.getMerkleProof(0);
|
||||
uint256 commitment = PoseidonT3.hash([1, uint256(rateLimit)]);
|
||||
|
||||
vm.warp(block.timestamp + w.activeDurationForNewMemberships() + w.gracePeriodDurationForNewMemberships() + 1);
|
||||
uint256[] memory ids = new uint256[](1);
|
||||
ids[0] = 1;
|
||||
w.eraseMemberships(ids, false); // Lazy
|
||||
|
||||
uint256 rootPost = w.root();
|
||||
assertEq(rootPost, rootPre); // No change in lazy mode
|
||||
|
||||
// Mock off-chain: Old proof validates on old (and new) root (spam risk)
|
||||
assertTrue(_verifyMerkleProof(proofPre, rootPre, 0, commitment, 20));
|
||||
assertTrue(_verifyMerkleProof(proofPre, rootPost, 0, commitment, 20)); // Still valid (risk)
|
||||
// On-chain invalid
|
||||
(,, uint256 postCommitment) = w.getMembershipInfo(1);
|
||||
assertEq(postCommitment, 0);
|
||||
}
|
||||
|
||||
function testFuzz_MultiUserEraseReuseRace(uint8 numUsers, bool fullErase) external {
|
||||
vm.assume(numUsers > 1 && numUsers <= 8);
|
||||
uint32 rateLimit = w.minMembershipRateLimit();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user