Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(weaver/samples): pin solc to v0.8.8 and turn off IR for Besu asset exchange #2430

Merged
merged 1 commit into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions weaver/samples/besu/simpleasset/truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,34 @@ module.exports = {
port: 9544, // 7545 - default for Ganache
network_id: "1338", // 4447 - default for Ganache
//type: "fabric-evm",
from: "0x3c7F5262b873F637F8AdA2B09C34624B7F5fbCBF",
from: "0x35D99e41ce0Aa49d1B2B62f286b9F4189df7B7ae",
gasPrice: 0,
gas: "0x1ffffffffffffe"
gas: "0x1ffffffffffffe",
verbose: true, // helps with debugging contract deployment issues
}
},
compilers: {
solc: {
version: "^0.8.8",
// Unless this is pinned to 0.8.8, some breaking changes that solc
// has snuck in [1][2] around 0.8.15 (for IR) are breaking the contract
// deployment in a way that opcodes end up in the migration contract's
// constructor that Besu does not recognize ("opcode INVALID") in
// the Besu logs and then sends back an "internal error" message
// via the JSON-RPC response, which is a bug IMO it should state
// that the user input was invalid (user input being the contract)
//
// [1]: https://docs.soliditylang.org/en/v0.8.15/ir-breaking-changes.html#semantic-only-changes
// [2]: https://github.com/ethereum/solidity/issues/13311#issuecomment-1199274310
version: "0.8.8",
settings: {
optimizer: {
enabled: true,
runs: 1500
},
viaIR: true,
// If set to true, then the following error occurs:
// > Compiling ./contracts/transferInterface.sol
// YulException: Variable var_amount_3290 is 9 slot(s) too deep inside the stack.
viaIR: false,
}

},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ cp ../artifacts/network$1/createKeyFile.js .
key=`cat $Node/data/key`
sed -i "s/<AccountPrivateKey>/$key/g" createKeyFile.js
touch keys/keyFile_${Node}
npm install web3
# Without this, the npm install will fail because of conflicting dependency versions
# that cannot be resolved properly unless "forced" (tested on Ubuntu 22.04)
# FIXME: Eliminate the need to do an npm install out-of-bounds like this entirely.
npm install --force web3
node createKeyFile.js > keys/keyFile_${Node}
rm createKeyFile.js
cp ../artifacts/account.toml keys/
Expand Down