Skip to content
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

BP Vote aggregation #49

Open
8 tasks
pmjanus opened this issue Feb 26, 2025 · 0 comments
Open
8 tasks

BP Vote aggregation #49

pmjanus opened this issue Feb 26, 2025 · 0 comments

Comments

@pmjanus
Copy link

pmjanus commented Feb 26, 2025

[Feature] Implement EVM Vote Weight Synchronization for Block Producers

🔄 Description
Create a new action in the system contract that synchronizes block producer vote weights between EVM and native chains, ensuring consistent voting power across both environments.

📋 Key Features

  • Read vote aggregates from EVM state for specific block producers
  • Compare with locally tracked vote weights on native side
  • Calculate and apply vote weight differences when detected
  • Maintain a persistent record of EVM vote weights in a dedicated table

🧠 Tasks

  • Create new action in system contract to fetch EVM vote weights for a specific BP
  • Implement table structure to store EVM vote weights on native side
  • Develop logic to compare EVM vs native vote weights and apply differences
  • Ensure only significant changes trigger state updates (optimization)
  • Add support for off-chain script to periodically call this action
  • Implement security measures to ensure only eosio account can modify EVM contract state
  • Configure zero gas price for all system contract to EVM transactions
  • Add comprehensive documentation for the new feature

🔐 Security Considerations

  • Native-to-EVM communications for BP registration/unregistration and decay multiplier updates must only be executable by the eosio account
  • The EVM contract should have the system contract address hardcoded for verification
  • All transactions from system contract to EVM should have 0 gas price
  • Add thorough testing
  • Consider audit.

🔄 Flow Example

  • Action called for BP with 0 previous EVM votes
  • System reads current EVM state showing 10^6 votes after decay
  • System adds these votes to the BP's total stake
  • System updates the EVM vote weights table with new value
  • No action taken if values remain unchanged between calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant