omgnetwork / plasma-mvp

OmiseGO's research implementation of Minimal Viable Plasma
MIT License
561 stars 158 forks source link

too many parameter when calling rootchain.submitBlock at child_chain.py #74

Closed ggs134 closed 6 years ago

ggs134 commented 6 years ago

https://github.com/omisego/plasma-mvp/blob/1683070b28bb64b0193f7dd4220957849fd6d317/plasma/child_chain/child_chain.py#L84

At child_chain.py, passing 2 parameters(block.merkle.root, self.current_block_number)

but at RootChain.sol, submitBlock() function recieves only 1 parameter(bytes32 root).

smartcontracts commented 6 years ago

I actually think we should revert here so that current_block_number is required. @DavidKnott?

DavidKnott commented 6 years ago

@kfichter I concur, block number is important to protect against miner transaction reordering invalidating the child chain.

paulperegud commented 6 years ago

@DavidKnott @kfichter aren't we protected against reordering-by-miner by nonces of authority account?

smartcontracts commented 6 years ago

@paulperegud hmm. I think yes, as long as there aren't any feasible client-side race conditions where block N is submitted before block N-1. Even something like an intermittent failure to connect to the RPC server could stop the submission of block N-1, but I feel like we should be handling those cases anyway.

Requiring the block # seems like an absolute way to make sure that the blocks can't accidentally be submitted in the wrong order. It also adds very little complexity.

smartcontracts commented 6 years ago

Fixed in #102