Skip to content

Conversation

@txhsl
Copy link
Contributor

@txhsl txhsl commented Jul 4, 2024

Close #239. Testing with 2000 candidateLimit...

@txhsl
Copy link
Contributor Author

txhsl commented Jul 4, 2024

With this policy check, the total gas cost of onPersist in the worst case will increase about 25%, making it slightly out of gas. We may have to lower down the candidateLimit at the same time to 1500 or so, or increase the syscall gas limit to 40_000_000 or so.

@txhsl txhsl requested a review from AnnaShaleva July 4, 2024 07:40
@AnnaShaleva
Copy link
Member

making it slightly out of gas.

I think we'd better increase the syscall GAS limit.

@txhsl txhsl force-pushed the governance-blacklist-check branch 2 times, most recently from 30499bf to e753b75 Compare July 4, 2024 10:31
@txhsl
Copy link
Contributor Author

txhsl commented Jul 4, 2024

@AnnaShaleva OK, now I have a good new idea to apply blacklist.

@txhsl txhsl requested a review from AnnaShaleva July 4, 2024 10:32
@txhsl txhsl force-pushed the governance-blacklist-check branch from e753b75 to a88db31 Compare July 4, 2024 10:39
@txhsl txhsl force-pushed the governance-blacklist-check branch from a88db31 to 448d885 Compare July 5, 2024 05:40
@txhsl txhsl force-pushed the governance-blacklist-check branch 2 times, most recently from d56de4b to 6819c4c Compare July 8, 2024 03:23
@txhsl txhsl force-pushed the governance-blacklist-check branch from 6819c4c to 080c45a Compare July 8, 2024 03:42
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM.

if (receivedVotes[candidate] > 0) {
totalVotes += receivedVotes[candidate];
}
emit Activate(candidate);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And just a minor note: if now we use a single notification for both usual registration and activation, then probably "Registered" is more preferable than "Activate"? Because in 99% cases it's a usual candidate registration, so users may be confused by receiving "Activate" notification rather than "Registered".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine, IMO.

Comment on lines +279 to +282
function deactivateCandidate(address candidate) external {
if (msg.sender != POLICY) revert Errors.SideCallNotAllowed();
if (_deactivateCandidate(candidate)) blacklistedCandidates += 1;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And a final note regarding blocked accounts: suppose candidate is in the list and is currently a CN. Once committee blocks this account, then this candidate won't be kicked off from the CN list immediately, instead it will remain there until the next epoch. We have a similar bug in NeoGo (nspcc-dev/neo-go#3449), and C# node handles this situation properly.

We may create an issue to handle that in future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ref. #248.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Black listed Policy feature is not used by Governance

3 participants