4339 - Submit abft score on chain #1868
Open
+271
−56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements PoC of a system that stores abft performance scores on chain. It's meant as a show case of the runtime part using unsigned transactions. The host/client counterpart is important only in one place when it shows how to submit a score.
In current version, the logic ensures that only one score is written to runtime storage every interval (parameter). It's hard to deduplicate transactions with valid next score that eg differs in signature at the transaction pool level. Instead, a softer invariant is provided. Only one tx per block can write a new score. On production, that should suffice since without an adversary, only at most 14 equivalent scores can be in one block, which is not a performance problem. If we expect some forging, we can require signed unsigned xt (such a curiosity exists in substrate). Moreover, the transactions are ordered at the pool level according to round for which they provide a score.
Type of change
Checklist:
spec_version
andtransaction_version