FourthState / plasma-mvp-rootchain

smart contract implementation according to the Plasma MVP spec.
Apache License 2.0
79 stars 24 forks source link

Removing Wasted Bytes #81

Open colin-axner opened 5 years ago

colin-axner commented 5 years ago

I think a future optimization to be considered is removing the requirement for 65 zero bytes to be passed in for the signature of a 1 input transaction. It would add a bit more logic to the rootchain, but reduces the block size of the sidechain (allowing more txs in a block).

ValarDragon commented 5 years ago

65 bytes of zeros cost 260 gas. Its not fully clear to me, but looking at the yellow paper codes it appears that the if statement gas is signifcantly smaller.

Also removing these 0 bytes is a significant improvement to tendermint block size, which should be a noticeable improvement to speed of consensus.

colin-axner commented 5 years ago

Remove padding of fixed length txBytes, The average tx will currently consistent of 250-500 unnecessary zero bytes. This will slow down processing on sidechain/increase storage.