fix(connector-besu): set contract bytecode field's max length to 49154 #3636
Labels
Besu
bug
Something isn't working
ethereum
Issues related to ethereum connector and peristence plugin
good-first-issue-100-introductory
Hacktoberfest
Hacktoberfest participants are welcome to take a stab at issues marked with this label.
P1
Priority 1: Highest
Xdai
Tasks/bugs related to the Xdai network and the corresponding ledger connector plugin in Cactus
Milestone
Describe the bug
Right now the Besu connector's API validates 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 uper limit of49154
characters.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."
To Reproduce
Try to deploy a contract that has 20k bytes (which is represented as 40k hex characters).
The API will refuse to accept the request due to the incorrect assumption that one hex
character equals on byte worth of bytecode.
Expected behavior
The Besu connector API should accept exctly as long bytecode as the EVM itself does on the
Ethereum mainnet.
Hyperledger Cactus release version or commit (git rev-parse --short HEAD):
main
at the time of this writing:https://github.com/hyperledger-cacti/cacti/tree/4424bf935a913ef046fcbcda822f46471a7f2b56
Hyperledger Cactus Plugins/Connectors Used
Additional context
The text was updated successfully, but these errors were encountered: