Skip to content

BP Vote aggregationΒ #49

@pmjanus

Description

@pmjanus

[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions