-
Notifications
You must be signed in to change notification settings - Fork 10
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
Handle pipefail in bash contract scripts #488
Conversation
WalkthroughThis pull request streamlines error handling across several shell scripts and updates logging procedures. The Dockerfile now specifies a fixed Foundry version and adopts stricter shell settings to improve reliability. GitHub workflow files have been adjusted by removing and adding version parameters accordingly. Additionally, both Go interface files and Solidity contracts have been updated to improve function parameter naming for clarity, while the test suite has been refined with renamed functions and explicit revert expectations. A new SARIF file is included to capture static analysis results. Changes
Sequence Diagram(s)sequenceDiagram
participant Function
participant Command
Function->>Command: Execute command
alt Command fails
Command-->>Function: Failure response
Function->>Function: Set BUILD_FAILED = true
else Command succeeds
Command-->>Function: Success response
end
Function->>Function: Check BUILD_FAILED flag
alt BUILD_FAILED is true
Function->>Console: Print error message and exit (status 1)
else
Function->>Console: Continue execution
end
sequenceDiagram
participant Dockerfile
participant RUN_Step
Dockerfile->>RUN_Step: Execute command (e.g., start anvil)
RUN_Step-->>Dockerfile: Return status
alt Command succeeds
Dockerfile->>Console: Log success message
else Command fails
Dockerfile->>Console: Log error and execute recovery steps (or exit with non-zero code)
end
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
contracts/dev/lib/common (1)
78-83
: 🛠️ Refactor suggestionUse consistent error handling style.
The function mixes two error handling styles:
BUILD_FAILED
variable and$?
check. For consistency with other functions, use the same pattern.Apply this diff:
forge build &> .forge_build.tmp.log || BUILD_FAILED=true - if [ $? -ne 0 ]; then + if [[ -n "${BUILD_FAILED:-}" ]]; then echo "ERROR: Failed to build contracts" cat .forge_build.tmp.log exit 1 fi
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
contracts/dev/lib/common
(6 hunks)dev/baked/Dockerfile
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: abis
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd)
- GitHub Check: Test (Node)
🔇 Additional comments (4)
contracts/dev/lib/common (3)
50-51
: LGTM!The error handling is well-implemented with proper cleanup of temporary files.
64-65
: LGTM!The error handling is well-implemented with proper cleanup of temporary files.
92-93
: LGTM!The error handling is well-implemented with proper cleanup of temporary files.
dev/baked/Dockerfile (1)
24-30
: LGTM! Well-structured error handling.The changes effectively handle pipefail with:
- Clear error messages for each step
- Appropriate warning for non-critical pkill failure
- Proper use of
set -euo pipefail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/build-pre-baked-images.yml (1)
52-52
: Add newline at the end of the file.Add a newline character at the end of the file to comply with POSIX standards and avoid potential issues with text processing tools.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 52-52: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/build-pre-baked-images.yml
(1 hunks)contracts/dev/lib/common
(6 hunks)dev/baked/Dockerfile
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- contracts/dev/lib/common
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/build-pre-baked-images.yml
[error] 52-52: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: abis
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd-cli)
- GitHub Check: Test (Node)
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd)
🔇 Additional comments (1)
dev/baked/Dockerfile (1)
24-30
: LGTM! Improved error handling and logging.Great improvements to the error handling and logging:
- Added
set -euo pipefail
to ensure script fails on any error- Added clear echo statements for each step
- Proper error messages with emojis for better visibility
- Graceful handling of pkill failure with a warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
contracts/dev/generate (1)
40-47
: 💡 Verification agent
⚠️ Potential issue🧩 Analysis chain
Fix file encoding issues causing ABI generation failures.
The pipeline failures show invalid character errors ('â') during ABI binding generation. This suggests UTF-8 encoding issues in the source files.
Let's verify the file encoding and check for problematic characters:
🏁 Script executed:
#!/bin/bash # Check for non-ASCII characters in source files find . -name "*.sol" -type f -exec file {} \; find . -name "*.sol" -type f -exec grep -P "[^\x00-\x7F]" {} \;Length of output: 679
Confirm file encoding consistency for Solidity contracts.
The ABI generation failures (error with invalid character 'â') suggest there may be UTF-8 encoding issues with one or more Solidity source files. The initial encoding check was inconclusive due to missing utilities. Please run the above script to detect any encoding problems. If any files report errors, ensure they are properly saved in UTF-8 format to avoid pipeline failures during ABI binding generation.
🏁 Script executed:
[run_scripts] #!/bin/bash # Verify Solidity source files for proper UTF-8 encoding using iconv. # This script checks each *.sol file to ensure it can be read as UTF-8. find . -name "*.sol" -type f | while read file; do if ! iconv -f utf-8 -t utf-8 "$file" -o /dev/null 2>/dev/null; then echo "Encoding error in: $file" fi doneLength of output: 3201
Update Solidity file encodings to valid UTF-8 to prevent ABI generation failures.
The verification script confirmed encoding errors in several Solidity files, which is likely causing the invalid character error (e.g., 'â') in the abigen pipeline. Please update the file encodings for the following files to UTF-8:
- ./contracts/test/Nodes.sol
- ./contracts/test/utils/Utils.sol
- ./contracts/test/IdentityUpdates.t.sol
- ./contracts/test/GroupMessage.t.sol
- ./contracts/src/IdentityUpdates.sol
- ./contracts/src/GroupMessages.sol
- ./contracts/src/Nodes.sol
- ./contracts/script/utils/Utils.sol
- ./contracts/script/utils/Environment.sol
- ./contracts/script/upgrades/UpgradeIdentityUpdates.s.sol
- ./contracts/script/upgrades/UpgradeGroupMessages.s.sol
- ./contracts/script/DeployNodeRegistry.s.sol
- ./contracts/script/DeployIdentityUpdates.s.sol
- ./contracts/script/DeployGroupMessages.s.sol
Correcting the encoding to valid UTF-8 should resolve the ABI generation failures.
🧹 Nitpick comments (1)
contracts/dev/generate (1)
17-48
: Add cleanup on failure in generate_bindings function.While the error handling is good, the function could benefit from proper cleanup of temporary files on failure.
Consider using a trap to ensure cleanup:
function generate_bindings() { local filename="$1" local package="$(echo "${filename}" | tr '[:upper:]' '[:lower:]')" local source_artifact="${source_dir}/${filename}.sol" local build_artifact="${build_dir}/${filename}" local output_artifact="${output_dir}/${package}/${filename}.go" + + function cleanup() { + rm -f "${build_artifact}"*.json + rm -f "${output_artifact}" + } + trap cleanup ERR rm -f "${build_artifact}".*.json mkdir -p "${output_dir}/${package}" rm -f "${output_dir}/${package}"/*.go
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
contracts/dev/generate
(1 hunks)contracts/output.sarif
(1 hunks)contracts/pkg/groupmessages/GroupMessages.go
(3 hunks)contracts/pkg/identityupdates/IdentityUpdates.go
(3 hunks)contracts/pkg/nodes/Nodes.go
(1 hunks)contracts/src/GroupMessages.sol
(3 hunks)contracts/src/IdentityUpdates.sol
(3 hunks)contracts/test/Nodes.sol
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- contracts/pkg/nodes/Nodes.go
🧰 Additional context used
🪛 GitHub Actions: Solidity
contracts/dev/generate
[error] 6-6: Failed to generate ABI binding: invalid character 'â' looking for beginning of value.
[error] 7-7: Failed to generate ABI binding: invalid character 'â' looking for beginning of value.
[error] 8-8: Failed to generate bindings for Nodes.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test (Node)
🔇 Additional comments (19)
contracts/dev/generate (1)
1-2
: LGTM! Proper error handling setup.The script correctly implements
set -euo pipefail
which aligns with the PR objectives to improve error handling in bash scripts.contracts/test/Nodes.sol (3)
102-111
: LGTM! Improved test naming and explicit revert expectations.The renaming from
testFail_ownerCannotUpdateHealth
totest_RevertWhen_OwnerCannotUpdateHealth
and the addition of explicit revert expectations improve test readability and clarity.
113-122
: LGTM! Consistent test naming pattern.The renaming from
testFail_ownerCannotTransfer
totest_RevertWhen_OwnerCannotTransfer
maintains consistency with the new naming pattern.
136-145
: LGTM! Clear error message and consistent naming.The renaming from
testFail_cannotChangeOtherHttpAddress
totest_RevertWhen_cannotChangeOtherHttpAddress
with an explicit error message improves test clarity.contracts/src/IdentityUpdates.sol (3)
56-68
: LGTM! Improved parameter naming in initialize function.The parameter renaming from
_admin
toadmin
follows Solidity naming conventions while maintaining functionality.
102-110
: LGTM! Clear parameter naming in setMinPayloadSize.The parameter renaming from
_minPayloadSize
tominPayloadSizeRequest
improves clarity and follows naming conventions.
113-121
: LGTM! Consistent parameter naming in setMaxPayloadSize.The parameter renaming from
_maxPayloadSize
tomaxPayloadSizeRequest
maintains consistency with the new naming pattern.contracts/src/GroupMessages.sol (3)
56-68
: LGTM! Consistent parameter naming with IdentityUpdates contract.The parameter renaming from
_admin
toadmin
maintains consistency with the IdentityUpdates contract.
103-111
: LGTM! Aligned parameter naming across contracts.The parameter renaming from
_minPayloadSize
tominPayloadSizeRequest
maintains consistency with IdentityUpdates.
114-122
: LGTM! Consistent naming patterns.The parameter renaming from
_maxPayloadSize
tomaxPayloadSizeRequest
follows the established pattern.contracts/output.sarif (1)
1-177
: LGTM! Static analysis results documented.The SARIF file properly documents the naming convention warnings from Slither, which have been addressed by the parameter renaming changes in the contracts.
contracts/pkg/groupmessages/GroupMessages.go (4)
34-35
: LGTM! ABI and Bin updates are consistent.The ABI string has been updated to reflect the parameter renaming changes in the contract functions.
528-531
: LGTM! Function parameter names have been improved.The parameter renaming changes improve code clarity by:
- Removing underscore prefixes
- Using more descriptive names (e.g.,
maxPayloadSizeRequest
)- Maintaining consistency across related functions
Also applies to: 612-614, 633-635
535-536
: LGTM! Documentation is consistent with code changes.The Solidity function documentation has been properly updated to reflect the parameter renaming changes, maintaining consistency between code and documentation.
Also applies to: 619-620, 640-641
34-35
:❓ Verification inconclusive
Verify impact on external integrations.
While the parameter renaming changes are backward compatible at the bytecode level, please ensure that any tools or scripts that parse the contract's ABI have been tested with the new parameter names.
Run the following script to find potential integration points:
Also applies to: 528-531, 612-614, 633-635
🏁 Script executed:
#!/bin/bash # Description: Search for potential integration points that might be affected by the ABI changes # Search for files importing this contract rg -l "github.com/.*?/contracts/pkg/groupmessages" # Search for direct references to the renamed functions rg -l "initialize.*_admin|setMaxPayloadSize.*_maxPayloadSize|setMinPayloadSize.*_minPayloadSize"Length of output: 469
Action Required: Verify External Integration Compatibility with ABI Changes
While the parameter renaming is backward compatible at the bytecode level, it may affect tools, scripts, or integrations that parse the contract's ABI. Please ensure that all external integrations have been validated against the updated ABI. In particular:
- Confirm that integrations in the following files are correctly handling the new parameter names:
pkg/testutils/contracts.go
pkg/api/payer/service.go
pkg/blockchain/blockchainPublisher.go
pkg/blockchain/interface.go
pkg/indexer/indexer.go
pkg/indexer/storer/groupMessage_test.go
pkg/indexer/storer/groupMessage.go
pkg/mocks/blockchain/mock_IBlockchainPublisher.go
pkg/utils/chainEvent_test.go
- Verify that any generated outputs (e.g.,
contracts/output.sarif
) reflect the new parameter names.- Ensure that integration points and tests around the ABI—especially in code segments 528-531, 612-614, and 633-635—are updated and pass regression tests.
contracts/pkg/identityupdates/IdentityUpdates.go (4)
34-35
: LGTM! ABI parameter names updated for clarity.The parameter names in the ABI have been updated to be more descriptive and consistent with the contract implementation.
528-545
: LGTM! Initialize function parameter renamed for clarity.The parameter name change from
_admin
toadmin
improves readability while maintaining functionality.
612-629
: LGTM! SetMaxPayloadSize function parameter renamed for clarity.The parameter name change from
_maxPayloadSize
tomaxPayloadSizeRequest
better indicates that this is a requested value to be set.
633-650
: LGTM! SetMinPayloadSize function parameter renamed for clarity.The parameter name change from
_minPayloadSize
tominPayloadSizeRequest
better indicates that this is a requested value to be set.
ABI: "[{\"type\":\"function\",\"name\":\"DEFAULT_ADMIN_ROLE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"addIdentityUpdate\",\"inputs\":[{\"name\":\"inboxId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"update\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getRoleAdmin\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"grantRole\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"hasRole\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"admin\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"maxPayloadSize\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minPayloadSize\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceRole\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"callerConfirmation\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"revokeRole\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMaxPayloadSize\",\"inputs\":[{\"name\":\"maxPayloadSizeRequest\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMinPayloadSize\",\"inputs\":[{\"name\":\"minPayloadSizeRequest\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"IdentityUpdateCreated\",\"inputs\":[{\"name\":\"inboxId\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"update\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"sequenceId\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MaxPayloadSizeUpdated\",\"inputs\":[{\"name\":\"oldSize\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newSize\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MinPayloadSizeUpdated\",\"inputs\":[{\"name\":\"oldSize\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newSize\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RoleAdminChanged\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"previousAdminRole\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"newAdminRole\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RoleGranted\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RoleRevoked\",\"inputs\":[{\"name\":\"role\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UpgradeAuthorized\",\"inputs\":[{\"name\":\"upgrader\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newImplementation\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AccessControlBadConfirmation\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AccessControlUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"neededRole\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EnforcedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ExpectedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMaxPayloadSize\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMinPayloadSize\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidPayloadSize\",\"inputs\":[{\"name\":\"actualSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maxSize\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ZeroAdminAddress\",\"inputs\":[]}]", | ||
Bin: "0x60a0604052306080523480156012575f5ffd5b506080516119af6100395f395f8181610d3701528181610d60015261107501526119af5ff3fe60806040526004361061013d575f3560e01c80635c975abb116100bb578063ba74fc7c11610071578063d547741f11610057578063d547741f146103df578063f96927ac146103fe578063fe8e37a314610412575f5ffd5b8063ba74fc7c146103a1578063c4d66de8146103c0575f5ffd5b806391d14854116100a157806391d14854146102c9578063a217fddf14610339578063ad3cb1cc1461034c575f5ffd5b80635c975abb1461027f5780638456cb59146102b5575f5ffd5b806336568abe116101105780634f1ef286116100f65780634f1ef2861461024357806352d1902d1461025657806358e3e94c1461026a575f5ffd5b806336568abe146102105780633f4ba83a1461022f575f5ffd5b806301ffc9a714610141578063248a9ca3146101755780632f2ff15d146101d0578063314a100e146101f1575b5f5ffd5b34801561014c575f5ffd5b5061016061015b36600461162d565b610431565b60405190151581526020015b60405180910390f35b348015610180575f5ffd5b506101c261018f36600461166c565b5f9081527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015490565b60405190815260200161016c565b3480156101db575f5ffd5b506101ef6101ea3660046116ab565b6104c9565b005b3480156101fc575f5ffd5b506101ef61020b36600461166c565b610512565b34801561021b575f5ffd5b506101ef61022a3660046116ab565b6105d6565b34801561023a575f5ffd5b506101ef610634565b6101ef610251366004611702565b610649565b348015610261575f5ffd5b506101c2610668565b348015610275575f5ffd5b506101c260015481565b34801561028a575f5ffd5b507fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16610160565b3480156102c0575f5ffd5b506101ef610696565b3480156102d4575f5ffd5b506101606102e33660046116ab565b5f9182527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b348015610344575f5ffd5b506101c25f81565b348015610357575f5ffd5b506103946040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b60405161016c9190611803565b3480156103ac575f5ffd5b506101ef6103bb366004611856565b6106a8565b3480156103cb575f5ffd5b506101ef6103da3660046118cd565b61078a565b3480156103ea575f5ffd5b506101ef6103f93660046116ab565b61097c565b348015610409575f5ffd5b506101c25f5481565b34801561041d575f5ffd5b506101ef61042c36600461166c565b6109bf565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806104c357507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800602052604090206001015461050281610a7e565b61050c8383610a88565b50505050565b5f61051c81610a7e565b6001548210610557576040517fe219e4f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8211610590576040517fe219e4f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80549083905560408051828152602081018590527f1ee836faee0e7c61d20a079d0b5b4e1ee9c536e18268ef6f7c620dcec82f72cd91015b60405180910390a1505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610625576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61062f8282610ba6565b505050565b5f61063e81610a7e565b610646610c82565b50565b610651610d1f565b61065a82610e25565b6106648282610f24565b5050565b5f61067161105d565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b5f6106a081610a7e565b6106466110cc565b6106b0611145565b5f5481108015906106c357506001548111155b5f546001548392610716576040517f93b7abe60000000000000000000000000000000000000000000000000000000081526004810193909352602483019190915260448201526064015b60405180910390fd5b50506002805467ffffffffffffffff808216600101167fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090911681179091556040517fc1a40f292090ec0435e939cdfe248e0322a88566679a90a50c4e9e5ef762dbd592506105c9918691869186916118e6565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff165f811580156107d45750825b90505f8267ffffffffffffffff1660011480156107f05750303b155b9050811580156107fe575080155b15610835576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016600117855583156108965784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b73ffffffffffffffffffffffffffffffffffffffff86166108e3576040517f3ef39b8100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108eb6111a1565b6108f36111a1565b6108fb6111a9565b60685f908155624000006001556109129087610a88565b5083156109745784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b62680060205260409020600101546109b581610a7e565b61050c8383610ba6565b5f6109c981610a7e565b5f548211610a03576040517f1d8e7a4a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62400000821115610a40576040517f1d8e7a4a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180549083905560408051828152602081018590527ff59e99f8f54d2696b7cf184949ab2b4bbd6336ec1816b36f58ae9948d868fe9091016105c9565b61064681336111b9565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616855290915282205460ff16610b9d575f8481526020828152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610b393390565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a460019150506104c3565b5f9150506104c3565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616855290915282205460ff1615610b9d575f8481526020828152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a460019150506104c3565b610c8a61125f565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a150565b3073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480610dec57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610dd37f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610e23576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f610e2f81610a7e565b73ffffffffffffffffffffffffffffffffffffffff8216610ed2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4e657720696d706c656d656e746174696f6e2063616e6e6f74206265207a657260448201527f6f20616464726573730000000000000000000000000000000000000000000000606482015260840161070d565b6040805133815273ffffffffffffffffffffffffffffffffffffffff841660208201527fd30e1d298bf814ea43d22b4ce8298062b08609cd67496483769d836157dd52fa910160405180910390a15050565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610fa9575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610fa69181019061194c565b60015b610ff7576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316600482015260240161070d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611053576040517faa1d49a40000000000000000000000000000000000000000000000000000000081526004810182905260240161070d565b61062f83836112ba565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610e23576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110d4611145565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833610cf4565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff1615610e23576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e2361131c565b6111b161131c565b610e23611383565b5f8281527f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268006020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610664576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024810183905260440161070d565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16610e23576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112c3826113d4565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156113145761062f82826114a2565b610664611521565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16610e23576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61138b61131c565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f0330080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b8073ffffffffffffffffffffffffffffffffffffffff163b5f0361143c576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161070d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60605f5f8473ffffffffffffffffffffffffffffffffffffffff16846040516114cb9190611963565b5f60405180830381855af49150503d805f8114611503576040519150601f19603f3d011682016040523d82523d5f602084013e611508565b606091505b5091509150611518858383611559565b95945050505050565b3415610e23576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608261156e57611569826115eb565b6115e4565b8151158015611592575073ffffffffffffffffffffffffffffffffffffffff84163b155b156115e1576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161070d565b50805b9392505050565b8051156115fb5780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6020828403121561163d575f5ffd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146115e4575f5ffd5b5f6020828403121561167c575f5ffd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146116a6575f5ffd5b919050565b5f5f604083850312156116bc575f5ffd5b823591506116cc60208401611683565b90509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f5f60408385031215611713575f5ffd5b61171c83611683565b9150602083013567ffffffffffffffff811115611737575f5ffd5b8301601f81018513611747575f5ffd5b803567ffffffffffffffff811115611761576117616116d5565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff821117156117cd576117cd6116d5565b6040528181528282016020018710156117e4575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b5f5f5f60408486031215611868575f5ffd5b83359250602084013567ffffffffffffffff811115611885575f5ffd5b8401601f81018613611895575f5ffd5b803567ffffffffffffffff8111156118ab575f5ffd5b8660208284010111156118bc575f5ffd5b939660209190910195509293505050565b5f602082840312156118dd575f5ffd5b6115e482611683565b84815260606020820152826060820152828460808301375f608084830101525f60807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116830101905067ffffffffffffffff8316604083015295945050505050565b5f6020828403121561195c575f5ffd5b5051919050565b5f82518060208501845e5f92019182525091905056fea2646970667358221220edfaa844b73bff305e3b72577a9d2da0ee115d6ef0e2586c3d79fdce90ea4b3264736f6c634300081c0033", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify parameter name updates in calling code.
The parameter names have been updated in the ABI and function signatures. Please ensure that all calling code has been updated to use the new parameter names:
_admin
→admin
_maxPayloadSize
→maxPayloadSizeRequest
_minPayloadSize
→minPayloadSizeRequest
Run the following script to find any potential callers that need to be updated:
Also applies to: 528-545, 612-629, 633-650
🏁 Script executed:
#!/bin/bash
# Description: Find potential callers that might need updates due to parameter name changes
# Search for old parameter names in function calls
echo "Searching for old parameter names in function calls..."
rg -A 2 -B 2 '_admin|_maxPayloadSize|_minPayloadSize'
Length of output: 7612
Verify and update parameter naming consistency across contracts and callers.
The latest static analysis shows that while the ABI in contracts/pkg/identityupdates/IdentityUpdates.go
now uses the new parameter names (e.g., admin
, maxPayloadSizeRequest
, minPayloadSizeRequest
), the Solidity source files still declare parameters with the old underscore prefixes. Specifically:
- In IdentityUpdates.sol (e.g., line 57 for
initialize
, line 104 forsetMinPayloadSize
, and line 115 forsetMaxPayloadSize
), the parameter_admin
,_minPayloadSize
, and_maxPayloadSize
are still used. - Similarly, GroupMessages.sol (e.g., line 57 for
initialize
, line 105 forsetMinPayloadSize
, and line 116 forsetMaxPayloadSize
) still use the underscore-prefixed names.
Please ensure that:
_admin
is updated toadmin
_maxPayloadSize
is updated tomaxPayloadSizeRequest
_minPayloadSize
is updated tominPayloadSizeRequest
This change should be consistently applied in both the contract definitions and their calling code (also affecting sections at lines 528–545, 612–629, and 633–650).
fba4a12
to
3f88851
Compare
@fbac ok. Now it passes. Let me know if any of the changes (especially the Solidity) are problematic |
The
set -e
set in the main script swallows all errors and custom error handling does not really work.Summary by CodeRabbit