Add contributors to seed function; add bulk node retrieval; and some small optimizations #51
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.
The seed function was only taking pubkeys and leaving operator and contributors empty, thus any seeded SNs would not be unlockable. This adds a huge, slow test for seeding 2000 service nodes to get an idea of how long it will take: with randomly generated 1-4 contributors in each, this ends up being approximately 600 million gas.
Adds a pair of methods for retrieving all unique ids + all bls pks, and for retrieving all bls pks without needing to walk the linked list.
Adds a few small optimizations that slightly reduce gas costs.
don't use the (expensive) serviceNodesLength(), but use totalNodes instead.
I'm not sure whether it's worth keeping serviceNodesLength() and updateServiceNodesLength(): they only seem to be there for a "what if something goes horribly wrong in the contract" case (i.e. totalNodes gets out of sync with the actual number of nodes we have), but I left them in (though now unused) for now.