This bounty is no longer available
Web3 DAO | phala-network Logo

Fast block speed in dev network

Organization

phala-network

Deadline

in over 262 years

Status

ENDED

225.6 USD

INSTRUCTIONS

Now it's fixed at 6s per-block. However we want a much faster block speed in development to save time. This is especially useful for e2e test, which can easily takes a few minutes to finish.

Substrate offers "Instant Seal" consensus engine, which can produce block every time when it receives a transaction instantly. However it doesn't meet our needs. We heavily depends on GRANDPA consensus and block justification to bridge the blockchain and pRuntime, but instant seal consensus engine doesn't have block justification at all. In theory we can open a hole in pRuntime to short-circuit the light validation logic all together, but it's still an error prone code change.

So an easier way is to just make the consensus engine produce blocks faster (<1s) for dev blockchain.

For Bounty Hunters

  • Deliverable:
    1. Fast block time while not breaking the existing system (should pass all unit tests & e2e test (under e2e/))
    2. The block time should be adjustable via cli option, and we should figure out the best value for it
    3. Document the changes
  • Resources
    • To build the project, follow the wiki tutorial environment section. The wiki is out-of-date, but it generally works expect we use rust nightly-2021-05-11 and llvm-10.
    • To run the e2e test, enter e2e/ and run yarn && yarn test. You should have phala-node, pherry (phost in the tutorial), and pruntime already compiled before running the e2e test.