filecoin-project / eudico Goto Github PK
View Code? Open in Web Editor NEWlotus, but also other things
License: Other
lotus, but also other things
License: Other
This is the main entrypoint for the sharding MVP. I'll try to keep here a checklist with TODOs
and issues to be implemented for the MVP.
Shard Actor
Eudico
Testing / Benchmarks
Post-MVP backlog
Docs
Housekeeping
The first instance of the protocol could simply assume that each participant is given a share of the secret key privately by a central authority and later on be coupled with the DKG.
Every peer needs to listen at least to its shard, the root chain, and its shard parent chain pubsub topic. Additional, to support cross-shard transactions, peers should have a way to proactively be able to join other shard pubsub topic to share and listen to messages.
We need to handle conveniently the pubsub topics a client is listening to when they join/leave a shard.
When leaving a shard we must:
Remove exchange
and hello
handlers for the shard if we no longer need them (i.e. we don't want to sync with the chain).
eudico/chain/sharding/exchange.go
Line 55 in ea618e3
eudico/chain/sharding/exchange.go
Line 78 in ea618e3
Remove all shard-related processes
When a peer joins a shard that has already mined a number of blocks, it doesn't seem to be syncing the previous state correctly. It successfully start listening to new blocks in the shard's pubsub topic but it throws the following error:
2021-10-05T12:26:56.423+0200 ERROR chain chain/sync.go:211 Received block with impossibly large height 163
Which means that it didn't synced with the shard.
We currently share the exchange.Client
between the root chain and child shards. This may be related:
Line 52 in 8174c43
In order for peers belonging to the same shard to run the same chain and be able to sync their state, their genesis should be the same. Right now, when a peer joins a shard, it deterministically generates its genesis (or so I thought):
eudico/chain/sharding/genesis.go
Lines 91 to 116 in ea618e3
Genesis blocks needs to be handled in a way in which all peers can have the same version. We can do this by:
shardActor
so it is accessible for everyone.(also the stmgr reverse registry)
When we leave a shard, we probably don't need to keep storing the shard's chain in the chainstore. We should figure out a way to (maybe optionally) remove the chain for a shard when we leave it.
Implement it as part of shard.Close()
?
eudico filcns daemon
to start a eudico node running filecoin consensus.We'll leave out of scope for now:
Use Frost threshold signing scheme where the set of signers is chosen randomly using a random beacon (which will be drand).
We currently accept every block from a valid miner that has followed the consensus algorithm we see in the shard's pubsub topic. We should only accept blocks that have been mined by a miner with mining rights in the shard (i.e. it is in the list of miners with enough stake in the shard). We need to add this check to validate blocks. This requires:
If an Eudico peer has joined a subnet, it should be able to instantiate and re-sync with the subnet after restarting the client. This is not the case in the current implementation. We'll fix this by:
We can approach this in different ways:
sync
command for subnets that can be used to explicitly sync with a subnet that we are part of. This prevents from automatically joining every subnet we are a member of when restarting our node.Done criteria:
Why important:
Customer:
Notes:
I assume this will be something like:
Implement interface X (see Y for an example)
Create a testground test like Z
...
To start with we could consider using S3 and later on adapt to Filecoin/IPFS.
Following discussion with @adlrocha it may be easier to leverage Filecoin infrastructure to store the data (not use the "usual" Filecoin storage which is very hard to retrieve at the moment). Using Filecoin saves some burden over having to run an IPFS node.
Create a script (e.g. bash) that can be used to replicate the new testnet easily.
Update: use docker container. @jleni to start on this next week.
Add subnet integration tests to eudico
following: https://github.com/filecoin-project/eudico/tree/eudico/itests
Currently it's checking worker keys / sig
As described in e7e2dfe#diff-dee04e9e331bf966a02f3dd193fa9dd9a7085ccba29bdae9db4cbaa290deb7ceR333-R346 in order to allow nodes to join shard topics we need to remove pubsub filters or add new filters that check if the topic follows a subnet naming convention.
Allowing listening to any topic may lead to some security issues.
The purpose of this tracking task is to collect estimates for the Eudico testbed that @magik6k is spearheading to help make ConsensusLab self-sufficient in running consensus experiments in 2021.
This table inlines the task name so it's easier for the estimator to know what issue they are giving an estimate to.
Issue # | Name | Estimate (ideal dev days) | Comments |
---|---|---|---|
#17 | Define and estimate testbed done state | ||
#1 | See if sync works, fix if needed | ||
#2 | Custom genesis support | ||
#3 | Custom vm invoker actor registry | ||
#4 | Figure out custom upgrade schedules | ||
#5 | Fix buildall / tests | ||
#6 | Upstream conesnsus package to lotus | ||
#7 | Implement tipset-proof-of-work example | ||
#8 | Add a custom actor example | ||
#9 | Setup itest to work with eudico networks | ||
#10 | [P4] Consider adding lotus-pond support | ||
#11 | Docs on architecture | ||
#12 | Docs on running example consensus | ||
#13 | Docs on creating new consensus | ||
#14 | Abstract lotus-miner (eudico-miner) | ||
#15 | Abstract incoming block validation |
This leverages GitHub's task list capability so can easily see the current status of each issue.
Provide an easy way to interact with shards, spawn new shards, join shards, etc. from CLI.
basic PoW consensus scaling difficulty based on avg past block count in tipsets. Should shed light on what bits of consensus code could use deduplicating
Test the protocol but instead of giving each participants their own share of the keys, use the output from the DKG algorithm.
These are the main tasks for the checkpointing project (project B2).
Rosario suggested the following implementation: https://github.com/ZenGo-X/multi-party-ecdsa
He also specified the following: That protocol includes the generation of RSA keys for the servers, which are used to do some computation tricks in the distributed computation of the ECDSA signatures. You would not need those.
Another colleague pointed out this implementation: https://github.com/drand/kyber/tree/master/share/dkg that they use in the drand protocol.
Use Frost where the set S of signers is deterministically chosen to be the first t participants (according to their indexes).
Depends on #3
(not sure if this is the best approach yet)
Would be nice to use the existing node constructor to get a libp2p node with pubsub instead of constructing it manually.
There are a few things in the sharding prototype and Eudico's code structure that may be quite "counterintuitive" and I am not proud of. I am deferring it to a near future so we can move fast now, but I wanted to list them here so we revisit them and don't forget about them. Actually, it may be a good exercise to approach this refactor while we write docs/tutorials for Eudico.
TipSetExecutor
for tspow consensus. There current implementation is a copy-paste of the delegated consensus':
eudico/chain/consensus/tspow/mine.go
Line 24 in cd8e6c8
eudico/chain/consensus/delegcns/mine.go
Line 22 in cd8e6c8
All the sharding
package and other sharding related processes are full of context.TODO()
. In order to effectively leave shards and join new ones will have to handle these contexts correctly.
There seems to be an issue for which after spawning a new shard, the node tries to create a new subshard in the child chain with the same name throwing the following error:
2021-10-01T11:04:46.760+0200 ERROR sharding sharding/sub.go:195 HandleIncomingMessages failed for shard {"shardID": "bafkqaclumvzxiu3imfzgi", "err": "duplicate validator for topic /fil/msgs/shard/bafkqaclumvzxiu3imfzgi"}
2021-10-01T11:04:46.760+0200 ERROR sharding sharding/sub.go:264 Error creating new shard {"shardID": "bafkqaclumvzxiu3imfzgi", "err": "duplicate validator for topic /fil/msgs/shard/bafkqaclumvzxiu3imfzgi"}
2021-10-01T11:04:46.760+0200 ERROR events events/events_called.go:228 chain trigger (@H 2, triggered @ 7) failed: duplicate validator for topic /fil/msgs/shard/bafkqaclumvzxiu3imfzgi
Is this because the changeState routing in sub.go
for the child chain detects that there's a new state change in the shard actor of the child chain when it is constructed, or because we are getting some state from the main chain that we shouldn't be getting? Why then can we be getting the ID of the shard in the child shard (which is exactly the same one of the main shard)?
This error is not priority because it won't affect the behavior of the system at this point, but it may be a consequence of a deeper issue so it is worth fixing it now.
We currently support exclusively delegated consensus in shards, so much of the code in https://github.com/filecoin-project/eudico/blob/sharding/chain/sharding/genesis.go is exclusive for delegated consensus.
We should:
Line 14 in 3b88d82
DelegatedMinerCmd
. Consider extracting this into a package that both can use (I think it make sense adding it to the consensus package).If possible get an early estimate on the number of nodes the protocol can scale to.
Is there a cryptographic bottleneck or only a communication bottleneck?
When a state change is detected in the shard actor of a shard, we need to check if that state change involves our peer in some way:
We are subscribed to every state change of the shard actor in the shards we are subscribed in, and we need to filter events conveniently.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.