Hi!
My team is currently tasked with developing Hyperchains - this thread will contain periodic(probably biweekly) public updates on the progress of development.
We finished and merged the initial Hyperchain parent DB
We finished and merged initial Hyperchain parent conector
Created a Chain Simulator parent connector
Sophia compiler refactoring for the necessary Erlang ACI helper library
What we are working on right now:
Sophia smart contract ACI helper
While working on the Staking contract deployment in HC and running benchmarks of our Sophia compiler it turned out that it is infeasible to ship hyperchains together with the compiler for encoding/decoding call data as the compiler would introduce a nasty bottleneck in block validation times - somewhere around 2-3 seconds for validating a single header… The ACI library is the only sensible option for proceeding further and will replace the compiler in some places in the node test suite.
Chain simulator improvements
The state channel test suite provided a chain simulator for testing various forking scenarios - after we started testing our Staking Contract it turned out that the only sensible way to test it is by using the chain simulator. Unfortunetelly as the Simulator was designed only for SC we are now in the progress of major refactorings to allow testing smart contract behavior during forking scenarios.
Connector DB integration
Save the data obtained from the parent chain in our DB
Parent chain connector manager
Manage parent chains and keep track of hard forks(changing the parent chain over the lifetime of the Hyperchain)
ACI helper:
Progress can be tracked here GitHub - aeternity/aesophia_aci_encoder
Right now this library works and was tested against all contract tests in the core node(I’ve intercepted calls to the compiler which got me a LOT of test cases). Some polishing needs to be done before integrating it in the core node test suite and the compiler.
Parent chain manager and DB integration:
We are still working on it, no draft PR yet.
ACI library:
The basic functionality required by the library was implemented - generic and quick call data encoding for Sophia contracts. The library went under extensive compatibility testing which revealed some bugs. Benchmarks show that this library is suitable for use in HC - Using the current version of the staking contract as a baseline:
Encoding using the compiler and the original contract: ~500 ms
Encoding using the compiler and an ACI stub: ~20ms
Customizable consensus engine - the aim is to first introduce PoA consensus to the node in order to check the new engine and to possibly switch over the Aeternity testnet to PoA
Parent chain manager and embedding of an BTC/ETH light client for hyperchains
Depending on approval we might start working on improving the developer experience in the ecosystem - to improve the usability of the ecosystem and development speed of aepps.
@inowhaveaename.chain Yes, There will be 2 ways to gain interest while securing the AE network:
Running and operating a node - when you get elected to produce blocks you will receive block rewards and transaction fees.
Delegating your coins to another delegate - when they become a validator then you will get a share proportional to your stake. All you will need to do is to enter a special Aepp and delegate your tokens
The work on the first real world parent connector has started - we are now in the process of choosing a BTC light client which will be embedded in the HC node
The upgraded chain simulator got merged
The testing suite for the staking contract is close to be merged
Customizable consensus layer in the node - this is still WIP and will be for some time. This also includes various sync performance optimizations - a bottleneck in the tx pool has been discovered which slows down sync.
Plans for next week:
BTC parent chain connector
Erlang to Purescript transpiler
Customizable consensus in the code, refactoring + performance improvements
My 2 cents: I hope they will launch once they’re ready but not before that. It is a project that is modifying quite some internals so this needs small steps and heavy testing.
Sync time
While working on the new consensus engine we removed as much bottlenecks in sync as possible - We still aren’t close to proper fast sync which is currently worked on by the AE foundation but It’s a decent improvement - After our fixes got merged the time to sync the first 20k generations on mainnet became reasonable.
We fixed and optimized our CI pipeline
Currently both the testing and build times improved. By taking advantage of the rocksdb upgrade the build times went down from 10 minutes to 2 minutes. There were some issues with build caching which we fixed. Some dependencies now aren’t rebuild every time we run our tests. There is still a small issue with deploys which we will fix on monday. Related PR’s:
Instant mining for tests as part of the new consensus engine Instant block mining by gorbak25 · Pull Request #3399 · aeternity/aeternity · GitHub
This reduced build times and will soon be placed under the new consensus engine. This will later be used not only for testing but also for “dev” mode which will improve the Aepp ecosystem dramatically.
Consensus engine
It’s still WIP - we hope to get it finished next week, right now we finalized user configuration and we started to write some tests for it.
Erlscriptem
I think this “demo” will describe our progress:
Currently we managed to transpile parts of the real erlang standard library and it actually works @nikitafuchs.chain we aim to transpile aesophia in the next 2 weeks Right now we still need to implement some missing erlang features in Erlscriptem:
Exception handling
Complex binary pattern matching and comprehensions(right now we only handle some easy cases - we came up how to handle any kind of binary pattern matching or bitstring comprehension a long time ago but we decided to postpone the implementation after we get a working “baseline”)
Right now Erlscriptem generates suboptimal code with regards to the final JS code size - we overestimated the ability of Purescript to optimise the Applicative typeclass - fortunately It’s trivial to change our code to generate friendly code for the Purescript optimizer
Connecting to BTC
We did a lot of research towards integrating a BTC light node in our software - we hope to finish the integration in the next 2 weeks
Hi bro.I check your reply ‘ Hyperchains - a new consensus algorithm which will allow you to stake your coins and gain interest from it while securing the Hyperchain Network. ‘by tg.
So I want to know can I stake my ae coins at Hyperchains?
When hyperchains will launch there will be 2 ways to gain interest:
Delegate your coins to a delegate via a webapp - This is the simplest way, just go to a fully decentralized and trustless DApp(this is why we are building the erlps compiler), choose your given delegate and always when the delegate is chosen to process blocks you will gain interest from your stake. It’s cheaper and less profitable than 2) but the UX will be amazing
Become a delegate - you essentially will become a miner and will be obligated to process transactions and submit commitments to the parent chain - The cost of operating a mining rig will still need to be fully determined - you won’t need expensive hardware but you need to have the money for submitting commitments to a given parent chain. In return you will get block rewards + transaction fees.