Today we are announcing the HPL project (high performance ledger). The goal is to implement a ledger on the IC that can receive and process 10,000 transactions per second which are initiated by different users and submitted in individual ingress messages.
To achieve this we have developed a multi-canister architecture for the ledger which operates multiple aggregators deployed on different subnets and a single ledger on another subnet. With every heartbeat, the aggregators forward transaction requests in batches to the ledger where they get processed.
We publish here GitHub - research-ag/hpl-io: The high-performance ledger :
- did file of the aggregator with comments
- did file of the ledger with comments
- README: a high-level overview of the goals and characteristics of the ledger
- README: description of how external clients (frontends, wallets) submit transactions and track progress by querying both aggregator and ledger
We would be grateful for review, comments and questions.
Please note that comments in the .did files and the README complement each other. We currently do not have a single document explaining everything.
The ledger and aggregators have been implemented and are deployed on 12 subnets, one for the ledger and 11 for aggregators.
To play around with the live deployment we have a demo frontend which is rudimentary but useful and much better than the raw candid UI. It is deployed here: https://debug.hpl.live/. Please see the comments in the .did files for an explanation of the functions that are exposed in this demo.
A first experience shows that the latency from clicking âSendâ on a transfer to the final confirmation of processing in the ledger is around 6-8 seconds most of the time. Sometimes it can be less, sometimes more. The latency is due to the extra inter-canister and, cross-subnet hop that is required.
We collect extensive metrics and provide a Grafana dashboard with various panels showing:
- Ledger:
- transaction rate (tps)
- batch rate
- number of registered accounts, owners, assets
- number of processed transactions
- heap memory
- Aggregators:
- high watermark of queue size
- number of concurrent batches in flight
- batch return time
The dashboard can be seen here: http://dashboard.hpl.live/
For example, it can be seen from the dashboard that most of the time there are 5 batches concurrently in flight from the same aggregator. But sometimes this number can peak to several times more.
It also shows that most of the time the response to a batch comes back after 6-7 seconds. But this number can also spike to several times more.
There are various other existing pieces of this project that are not yet ready to be published (but publication will follow):
- Motoko implementation of the aggregator
- Motoko implementation of the ledger
- client library (typescript) for transaction submission
- demo frontend source code
And of course there are many, many more pieces left for which work is either in progress or hasnât started yet.
Have fun with it!
And again, we would be grateful for review and comments on the published interface.