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.
This PR makes changes to the node to add support for attributed execution. If the node is instructed to do so (by using the
--attributes true
CLI flag, it will try to load its attributes from IPFS/IPNS. The location where the node searches its data is determined by its public key.On boot, the node will try to download the
attributes.bin
file from the relevant path. The code uses the Cloudflare IPFS gateways. Not sure if it's a transient thing, but the past week or so whenever I tested, that gateway was pretty solid in catching new IPNS names, while other gateways didn't sync.Node caches those attributes in memory, so if the attributes need to be reloaded - the process has to be restarted.
Execution requests
Execution requests requesting specific attributes have the following form:
The
attributes
file is optional. If needed, it can take the following format:attestation_required
(boolean) - the node has at least one attestor, whichever it isattestors
- object, with the following fields:each
(peer.ID) - each of the listed attestors should be foundone_of
(peer.ID) - any one attestor from the list will sufficevalues
- list of objects withname
andvalue
pairs, specifying attributes that the node should have. at the moment we support exact matches onlyExample:
All of these values can be combines and used independently from each other, so e.g. only
attestation_required
can be set, or only the wanted attributes.Roll Call
Head node passes along the attributes value on roll call to worker nodes. Worker nodes check by themselves if they fulfill the criteria and ignore the roll call if they do not (logging the condition which eliminated them from contention).
Head node does not double-check the reporting peers. It may be a good idea for robustness to have also workers send their attributes to the head node which could double-check them, to make sure none of them are filthy liars.