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

Problem: relayer doesn't make use of binding contract #1193

Closed
wants to merge 4 commits into from

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented Oct 5, 2023

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

@mmsqe mmsqe changed the title Problem: relayer does't make use of binding contract Problem: relayer doesn't make use of binding contract Oct 5, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: mmsqe <[email protected]>
Comment on lines +47 to +60
for methodName, _ := range irelayerABI.Methods {
var methodID [4]byte
copy(methodID[:], irelayerABI.Methods[methodName].ID[:4])
switch methodName {
case CreateClient:
relayerGasRequiredByMethod[methodID] = 200000
case RecvPacket, Acknowledgement:
relayerGasRequiredByMethod[methodID] = 250000
case UpdateClient, UpgradeClient:
relayerGasRequiredByMethod[methodID] = 400000
default:
relayerGasRequiredByMethod[methodID] = 100000
}
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m Error

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 3
Comment on lines +47 to +60
for methodName, _ := range irelayerABI.Methods {
var methodID [4]byte
copy(methodID[:], irelayerABI.Methods[methodName].ID[:4])
switch methodName {
case CreateClient:
relayerGasRequiredByMethod[methodID] = 200000
case RecvPacket, Acknowledgement:
relayerGasRequiredByMethod[methodID] = 250000
case UpdateClient, UpgradeClient:
relayerGasRequiredByMethod[methodID] = 400000
default:
relayerGasRequiredByMethod[methodID] = 100000
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Merging #1193 (3359182) into main (26ee8c7) will increase coverage by 19.70%.
The diff coverage is 5.85%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1193       +/-   ##
===========================================
+ Coverage   16.73%   36.43%   +19.70%     
===========================================
  Files          79      116       +37     
  Lines        5766    10374     +4608     
===========================================
+ Hits          965     3780     +2815     
- Misses       4723     6220     +1497     
- Partials       78      374      +296     
Files Coverage Δ
x/cronos/keeper/precompiles/utils.go 0.00% <0.00%> (ø)
x/cronos/keeper/precompiles/relayer.go 21.27% <19.04%> (-4.53%) ⬇️
...s/precompile/relayer/i_relayer_functions.abigen.go 0.00% <0.00%> (ø)

... and 54 files with indirect coverage changes

@mmsqe mmsqe closed this Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant