-
Notifications
You must be signed in to change notification settings - Fork 115
Add ERC20 token-based Proof of Stake validator management #2994
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update sendMsg to use the new SimulateTransaction function which uses standard eth_call instead of debug_traceTransaction. When a transaction fails, extract and display the error selector and revert data to help users debug the issue. Update SDK dependency to version that eliminates debug RPC method dependency, ensuring all CLI flows work with any standard EVM RPC endpoint.
When gas estimation was enforced (after removing debug trace fallback), validator removal began failing with "min stake duration not passed" even though system time had passed the threshold. This occurred because eth_estimateGas uses the current block timestamp, which can lag behind system time, especially right after the minimum stake duration expires. The contract check in StakingManager sets validator.endTime to block.timestamp during initiateValidatorRemoval, then immediately checks: if (block.timestamp < startTime + minStakeDuration) revert During gas estimation, this uses the CURRENT block's timestamp. When the actual transaction would be mined in a NEW block with a LATER timestamp, it would succeed. But with gas estimation now enforced, the transaction never gets submitted. Solution: Before attempting removal, check the current blockchain timestamp. If it hasn't passed the threshold yet, create a dummy block (via self-transfer with 0 value) to advance the blockchain time. This ensures gas estimation will succeed using the updated block timestamp. This fix is necessary for the new SDK behavior that enforces gas estimation errors instead of falling back to a default gas limit.
jasonatran
approved these changes
Dec 19, 2025
This was referenced Dec 22, 2025
This was referenced Dec 23, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this should be merged
This PR implements ERC20 token-based Proof of Stake validator management as an alternative to native token staking. This provides more flexibility for L1 validator economics by allowing custom tokens to be used for staking instead of being limited to native tokens.
Key improvements:
How this works
ERC20 PoS Implementation:
Validator Management Type Refactoring:
Validator Manager Improvements:
CLI Enhancements:
How this was tested