Protocol: VM Bytecode Commitment circuit #3152
Labels
A-documentation
Area: relates to documentation
A-protocol
Area: relates to designing / explaining the protocol
This is a tricky one, because the VM opcodes haven't been finalised, yet. Nevertheless, it would be great if we could understand the logic and assertions that this circuit will need to make.
When a public function is deployed, its bytecode is broadcast to the network. But there are currently no checks to ensure the broadcasted bytecode actually relates to the function tree root that's embedded in the contract's address. This could be a possible griefing attack for sequencers. They might be requested to execute a function of a contract, lookup the bytecode that was broadcast at the time the contract was deployed, only to discover the bytecode is irrelevant. This realisation might take too much time (e.g. the sequencer might need to hash or commit to the bytecode, and then check it against the contract's function tree). TODO: check if this would indeed take too much time, and that this is indeed a possible griefing attack vector.
To address this problem, a circuit could be executed at the time of deployment, to prove that the broadcast bytecode relates to the function tree, e.g. by committing to the bytecode, and showing that the resulting commitment is contained within a leaf of the function tree.
The text was updated successfully, but these errors were encountered: