-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Application] feat: Add past delegation proofs #518
Conversation
@red-0ne Confirming that this is not ready for initial review yet. Right? |
It is, just lacking E2E tests from the previous PR to be ported to this one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@red-0ne Please do the following:
- See my comments. Even if they're outdated (based on code), PTAL at all of them
- Review my commit in
82abcc8
(#518). Note the comments I made and the var changes I made. - Let's make the same changes as in (2) everywhere across the PR
- Please respond to my comments in (1)
- Re-request the review (even if it's still not complete) once I can start taking a look at what we have.
Other than that, love how much simpler this is!
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
// that have been undelegated after the target session end height. | ||
func GetRingAddressesAtBlock(app *apptypes.Application, blockHeight int64) []string { | ||
// Get the target session end height at which we want to get the active delegations. | ||
targetSessionEndHeight := uint64(sessionkeeper.GetSessionEndBlockHeight(blockHeight)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to take grace period into account here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grace period as a special block count/height interval, should not be taken into account.
Getting the delegatee gateway addresses when in a session's grace period effectively involves looking past SessionGracePeriod
number of sessions, so all it needs is that the pending undelegations are not pruned which is ensured by GetNumBlocksUndelegationRetention
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this implicitly assume that GetNumBlocksUndelegationRetention
> SessionGracePeriod
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, pruning is guarenteed to be >= SessionGracePeriod
func GetNumBlocksUndelegationRetention() int64 {
return sessionkeeper.GetSessionGracePeriodBlockCount() +
(sessionkeeper.NumBlocksPerSession * NumSessionsAppToGatewayUndelegationRetention)
}
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one @red-0ne! 😎
I have to take a break on this for now but I'm almost to the end:
Great comments! 💪
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
x/application/keeper/msg_server_undelegate_from_gateway_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my last two comments but pre-emtively approving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks. If you just created a pull request, you might need to push another commit to produce a container image DevNet can utilize to spin up infrastructure. You can use |
Summary
This PR adds support for old delegations verification by:
1129 LOC out of 1314 are autogenerated pulsar code
Issue
Type of change
Select one or more:
Testing
Documentation changes (only if making doc changes)
make docusaurus_start
; only needed if you make doc changesLocal Testing (only if making code changes)
make go_develop_and_test
make test_e2e
PR Testing (only if making code changes)
devnet-test-e2e
label to the PR.make trigger_ci
if you want to re-trigger tests without any code changesSanity Checklist