Skip to content

Consider updating design of ProposalVotes struct #34

Open
@mialbu

Description

@mialbu

When multiple members vote at the same time, transactions can lead to have an insufficient system fee. This is due to the increased size of the ProposalVotes struct, that is deserialised in the method vote(). More precisely, the map voters is increasing whenever a member votes, which eventually increases the system fee for the next voters. In case two or more members create a transaction (i.e., including the required system fee) at the same time, the transaction that is processed later might fail due to a system fee that is too low.

Suggestion

Remove the map voters from the struct ProposalVotes and create storage entries for each member that is structured the following way:

Prefix: The script hash of the member
Key: The proposal id
Value: The member's vote for that proposal

Additionally, a new method could iterate through all members, create a map with their hash and their votes to provide information about what member voted how for a proposal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions