Try   HackMD

Design idea of universal L2 client

These are ideas to make more efficient use of OVM. This architecture enables client more extensible and reduces application specific code.

Storing and loading local information

A quantifier queries local database to fetch local information such as signatures and messages.
It's hard to expect how future claims want to query local information.
How do we build local information database adapting each quantifiers, and how to build mupti-platform OVM implementation on it?

One solution for that is the approach like multi model database.
Local information are stored to Key-Value-Store.
Once an user define claim and it quantify local information, index for data is created.

For example.

for all b such that b < 10:
  for all state_update such that within range(b, range):

The query should be SELECT state_update WHERE block_number = 10 and 0 < range.start and range.end < 100.

for all tx such that state_update.block_number < tx.block_number and tx.range is within state_update.range:

The query should be SELECT state_update WHERE 0 < range.start and range.end < 100 and 10 < block_number.

Sending and recieving local information

It's hard to implement client for each L2 construction.
How do we abstract communication between clients include transaction aggregator?

When the client receives query from claim, client should fetch local information from layer 2 network.

In quantifier, we use db to query local information.

db.query("SELECT ...")

Other client which has local information matched to the query send back data.

let data = await db.query("SELECT ...")

Conclusion

By this architecture

  • quantifier become more abstract(we don't need prepare Plasma specific quantifier)
  • reduce client code(we can reduce Plasma specific client code)

This architecture makes client more extensible and we need less code.
It means we can reduce developer's effort to build universal client for each platform, and also reduce application developer's effort to build application specific client logic.
But there would be some hardle to implement flexible database for multi platform.

Added Sep 25 2019

https://twitter.com/ben_chain/status/1176598715127214080?s=20

Quantifiers should have specific logic corresponding to L2 construction.