omgnetwork / omg-childchain-v2

pronounced /Ch-ch/
Apache License 2.0
5 stars 2 forks source link

Create Separate Block tables for Plasma vs Deposit Blocks #104

Closed achiurizo closed 4 years ago

achiurizo commented 4 years ago

We keep Plasma Blocks and Blocks separate, because they're not the same thing and because Deposit blocks can clash in hashes. Engine.DB.Block should be renamed to DepositBlock. In my opinion.

Originally posted by @InoMurko in https://github.com/omgnetwork/childchain/pull/99


We should separate out the deposit and plasma blocks. They aren't really used the same way. Additionally, this will help us with having plasma blocks be unique to search on(re: tx_hash collisons with DepositBlock)

achiurizo commented 4 years ago

The first approach is still keep a separate table with the information until we know what we want to do this with this from a product perspective(push this later into a backoffice)

InoMurko commented 4 years ago

Just a few clarifications: API

block.get

serves plasma blocks from the plasma_block table. Plasma blocks are not being created yet! Just so you don't look for them.

Deposit blocks are not exposed via API.

Deposit blocks are only being created when we callback from the Ethereum Event Listener: https://github.com/omgnetwork/childchain/blob/master/apps/engine/lib/engine/ethereum/sync_supervisor.ex#L60-L67