hyperledger-cacti / cacti

Hyperledger Cacti is a new approach to the blockchain interoperability problem
https://wiki.hyperledger.org/display/cactus
Apache License 2.0
344 stars 286 forks source link

fix(connector-besu): set contract bytecode field's max length to 49154 #3637

Open petermetz opened 1 week ago

petermetz commented 1 week ago

Prior to this commit the Besu connector's API validated requests when deploying solidity contracts via their bytecode such that the length of the bytecode parameter cannot be longer than 24576 characters, but instead it should have an upper limit of 49154 characters because each byte is represented as two characters in hex.

See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode. 2 + (24576 * 2) = 49154 meaning that hex stores each byte in 2 characters and that there is a 0x prefix (2 characters) which does not count towards the EVM 24576 bytecode limit."

Fixes #3636

Signed-off-by: Peter Somogyvari peter.somogyvari@accenture.com

Pull Request Requirements

Character Limit

A Must Read for Beginners For rebasing and squashing, here's a must read guide for beginners.