-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Some smart-contracts require aggregation of information from many external accounts (multisig, DAO, off-chain computation, data collection, oracles, etc.).
On Aergo it can be done with individual transactions, as they are cheap.
Problem
The problem is in storage: if the transactions are processed separately (one on each block) then it would use a lot of state space
(BTW this should be reflected on the tx cost)
Proposed Solution
Make the aergo nodes hold the consensus-driven transactions for a while until a minimum amount of txns or a time threshold has reached, then process them all in a single block.
The holding of txns could be done at mempool level
This is to be used only with contracts that have some special metadata / identifier. it could be:
- a specific function name
- a flag on the ABI
The transactions also need to have some special identifier, it can be:
- a call to that specific function name (so multicall will not work. fee delegation could be supported)
- another tx type or modifier/flag
As a contract can have many functions that may use this feature, the identifier could be in part of the name (instead of the full one) like this:
-- for off-chain computations
function send_result__aggregate_transactions(request, result)
...
end
-- voting on some proposal
function vote__aggregate_transactions(proposal_id, vote)
...
end