Skip to content

ACP-236 (5): Add proposal execution for auto-renewed validators#5204

Open
rrazvan1 wants to merge 5 commits intorazvan/acp-236-s4from
razvan/acp-236-s5
Open

ACP-236 (5): Add proposal execution for auto-renewed validators#5204
rrazvan1 wants to merge 5 commits intorazvan/acp-236-s4from
razvan/acp-236-s5

Conversation

@rrazvan1
Copy link
Copy Markdown
Contributor

@rrazvan1 rrazvan1 commented Apr 8, 2026

Why this should be merged

Implements the proposal-side execution that handles staking period expiry and reward/renewal logic for auto-renewed validators.

How this works

  • Extends ProposalTxExecutor to process RewardAutoRenewedValidatorTx, handling reward calculation, auto-compounding, and re-staking for the next period.

How this was tested

Covered by the reward validator tests added in #5205 .

Need to be documented in RELEASES.md?

No

Comment thread vms/platformvm/txs/executor/proposal_tx_executor.go
Comment on lines 343 to 347
switch {
case tx == nil:
return txs.ErrNilTx
case tx.TxID == ids.Empty:
return ErrInvalidID
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.

Should this live in the new helper verifyRewardTx?

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.

the proper change would be moving this in RewardValidatorTx.SyntacticVerify(..) func

It cannot be moved in verifyRewardTx, because RewardAutoRenewedValidatorTx has the same checks (+ timestamp), in RewardAutoRenewedValidatorTx.SyntacticVerify(..), so there is an inconsistency of behaviour among rewards transactions.

The reason I chose not to move the RewardValidatorTx checks inside SyntacticVerify(..), is to have mininal changes in legacy code.

return nil
}

func (*proposalTxExecutor) RewardAutoRenewedValidatorTx(*txs.RewardAutoRenewedValidatorTx) error {
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.

Can we undo this move? This makes the diff a bit more difficult to review since it makes less clear that we refactored code into a new decreaseAbortStateCurrentSupply func. I think you probably did this to either have all usages of that new helper before its declaration, or to have exported code before unexported code, but I don't think there is a guideline for this in Google's style guide (correct me if wrong) and I generally try to optimize for easier PR reviews in these cases when I'm touching existing code.

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 did not move it 🤔, this is how git shows the diff...

Comment thread vms/platformvm/txs/executor/proposal_tx_executor.go Outdated
Comment thread vms/platformvm/txs/executor/proposal_tx_executor.go
Copy link
Copy Markdown
Contributor

@joshua-kim joshua-kim left a comment

Choose a reason for hiding this comment

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

I thought this was in the previous PR batch but I forgot to post these...

Comment on lines 591 to 604
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.

Seems like we can refactor this w/ the new createUTXOsStakeOut function if we make the tx parameter accept the txs.PermissionlessStaker interface now

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.

check the new changes!

Comment thread vms/platformvm/txs/executor/proposal_tx_executor.go Outdated
Comment thread vms/platformvm/txs/executor/proposal_tx_executor.go Outdated
@rrazvan1 rrazvan1 force-pushed the razvan/acp-236-s5 branch from 192a105 to d6b7393 Compare May 5, 2026 12:24
@rrazvan1 rrazvan1 force-pushed the razvan/acp-236-s4 branch from 73132fb to 801ccfd Compare May 5, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acp236 Continuous Staking

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants