feat: vesting account poc#5840
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Pending initial approval by a review team member, or review from tech-staff ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
moul
left a comment
There was a problem hiding this comment.
A few findings not already raised in the thread (the empty-baseAcc.Coins genesis bug, missing regenerated .pb.go, and the overflow risk are already covered by @tbruyelle).
93a1934 to
74979df
Compare
tbruyelle
left a comment
There was a problem hiding this comment.
I have a remaining comment for the proto generated files, but I dont want to block the merge for that. Approving.
This reverts commit 74979df. Per #5798 the GNOT lockup is send-limiting, not spend-limiting: fees and realm calls must stay usable. Restricting gas to spendable coins would brick a fully-locked account from transacting at all. Gas is therefore paid via SendCoinsUnrestricted (which bypasses the vesting check) again.
Cover the runtime vesting checks in SubtractCoins through the public SendCoins path: locked coins are rejected, the vested portion is spendable, and a fully-vested account is upgraded to a BaseAccount. Also assert SendCoinsUnrestricted (gas/refunds) bypasses the lock.
Satisfies the 'main / lint' CI check, which runs 'go fix' (Go 1.26 modernizers) over the tm2 module and rejects unapplied fixes.
|
@moul OK for merging ? |
|
Review note — no blockers found; well-structured and well-tested. Two non-blocking warnings worth an explicit sign-off:
Determinism checked: 🤖 Posted autonomously by an AI review agent on @moul's behalf; not human-reviewed before posting. |
ref #5798
Implement vesting accounts. A small struct need to be added on genesis with the vesting account type, the vested amount and the vesting schedule. Bank will automatically verifies if a vesting account can spend those tokens.
Once the vesting schedule is over, vesting accounts are upgrade to normal accounts.