Skip to content

feat(node): integration rewards, review comments.#1205

Merged
raulk merged 35 commits intointegration/rewardsfrom
raulk/rewards-review
Nov 25, 2024
Merged

feat(node): integration rewards, review comments.#1205
raulk merged 35 commits intointegration/rewardsfrom
raulk/rewards-review

Conversation

@raulk
Copy link
Copy Markdown
Contributor

@raulk raulk commented Nov 15, 2024

Calibration testing:
SubnetRegistryDiamond deployed at 0xbCC8CAbbf2f33D5665B176692CDc6B1135bAE05E
GatewayDiamond deployed at 0x689D7fAD1a77d9aDc7d2C724c366C8EF8D919184

}

/// The proofs to batch claim validator rewards in a specific subnet
/// REVIEW(raulk): Delete this type. Make the method just take the subnet ID and the list of claim proofs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@raulk I think this type is introduced to handle multiple subnet ids at once. With this structure, might be easier to manage types. Or this requirement is not needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So there's two levels of batching:

  1. Claim rewards corresponding to multiple checkpoint heights for a single subnet at once.
  2. Claim rewards from multiple subnets, over multiple checkpoint heights for each subnet, at once.

I would only support (1) and not (2) as:

  1. It limits attack surface by constraining interactions to a single subnet within a transaction.
  2. It sounds like premature optimization to me, and once introduced it will be impossible to remove even if nobody uses it.

My suggestion is that we descope (2) and limit ourselves to (1). With that in mind, we can kill the extra type and simply have three arguments:

  • subnet ID
  • array of checkpoint heights
  • array of claims

Copy link
Copy Markdown
Contributor

@cryptoAtwill cryptoAtwill left a comment

Choose a reason for hiding this comment

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

@raulk I have push the changes to the contract. Please help take a quick look as there are some slight adjustments to fit the overall flow. Once this is ok, fendermint is very easy to change.

/// The proof required for validators to claim rewards
struct ValidatorClaimProof {
ValidatorSummary summary;
uint64 checkpointHeight;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@raulk Add in checkpoint height to identify which commitment to use

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this should be an unwrapped argument. It is not part of the proof per se, but rather an extra argument we need to pass to the method to identify the height against we're presenting the proof. For the batch claim, we should take an array of heights and an array of proofs.

Copy link
Copy Markdown
Contributor Author

@raulk raulk Nov 18, 2024

Choose a reason for hiding this comment

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

See related design comment: #1205 (comment).

@cryptoAtwill cryptoAtwill changed the title integration rewards: review comments. feat(node): integration rewards, review comments. Nov 18, 2024
@cryptoAtwill cryptoAtwill changed the base branch from integration/rewards to main November 19, 2024 12:00
@cryptoAtwill cryptoAtwill changed the base branch from main to integration/rewards November 19, 2024 12:00
raulk and others added 4 commits November 19, 2024 20:09
- rename and retype to attempt to stabilize the data model.
- introduced the notion of activity bundles, validator data, compressed summary, full summary.
- remove wrapped types for arguments to reduce type complexity.
- constrain batch claims to a single origin subnet to simplify solution.

still doesn't compile / need help!
@cryptoAtwill cryptoAtwill marked this pull request as ready for review November 20, 2024 08:23
@cryptoAtwill cryptoAtwill requested a review from a team as a code owner November 20, 2024 08:23
@raulk raulk merged commit 69e04a9 into integration/rewards Nov 25, 2024
@raulk raulk deleted the raulk/rewards-review branch November 25, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants