You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 methodvote()
. More precisely, the mapvoters
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 structProposalVotes
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.
The text was updated successfully, but these errors were encountered: