celo-org / celo-blockchain

Official repository for the golang Celo Blockchain
https://celo.org
GNU Lesser General Public License v3.0
560 stars 198 forks source link

fix: udp already listening issue #2147

Closed kehiy closed 1 year ago

kehiy commented 1 year ago

Description

I added a missing defer in main function of node

Other changes

also i used go fmt command for make code structure clean

Related issues

kehiy commented 1 year ago

@shazow @fjl @Shadowfiend @jmcnevin

karlb commented 1 year ago

The new defer makes sense and looks like it should resolve the linked issue (I didn't actually try it out yet).

The format change is nothing we want to include at the moment, because it increases the diff to the upstream geth version and will cause additional merge conflicts when updating to more recent upstream versions. The code is already formatted with gofmt, but with version 1.18 specifically to avoid this problem. You probably used a more recent gofmt version.

Thanks for the PR!

kehiy commented 1 year ago

The new defer makes sense and looks like it should resolve the linked issue (I didn't actually try it out yet).

The format change is nothing we want to include at the moment, because it increases the diff to the upstream geth version and will cause additional merge conflicts when updating to more recent upstream versions. The code is already formatted with gofmt, but with version 1.18 specifically to avoid this problem. You probably used a more recent gofmt version.

Thanks for the PR!

is that going to be merged or not? only the connection part (if the formatting is not planned)

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.03 :warning:

Comparison is base (e10394d) 55.31% compared to head (7fb7a0c) 55.29%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2147 +/- ## ========================================== - Coverage 55.31% 55.29% -0.03% ========================================== Files 675 675 Lines 113723 113723 ========================================== - Hits 62905 62881 -24 - Misses 46974 46996 +22 - Partials 3844 3846 +2 ``` [see 31 files with indirect coverage changes](https://app.codecov.io/gh/celo-org/celo-blockchain/pull/2147/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

kehiy commented 1 year ago

The tests succeed, the CI just seems to be unable to post a PR comment (I assume because the PR is made from a different repo).

yeah, maybe(?)

github-actions[bot] commented 1 year ago

Coverage from tests in ./e2e_test/... for ./consensus/istanbul/... at commit e4359ea5c7f4bc5cfb679d9038bed21fbc7a82ec

coverage: 47.7% of statements across all listed packages
coverage:  59.6% of statements in consensus/istanbul
coverage:  40.5% of statements in consensus/istanbul/announce
coverage:  54.5% of statements in consensus/istanbul/backend
coverage:   0.0% of statements in consensus/istanbul/backend/backendtest
coverage:  24.3% of statements in consensus/istanbul/backend/internal/replica
coverage:  57.9% of statements in consensus/istanbul/core
coverage:  45.0% of statements in consensus/istanbul/db
coverage:   0.0% of statements in consensus/istanbul/proxy
coverage:  64.4% of statements in consensus/istanbul/uptime
coverage:  51.8% of statements in consensus/istanbul/validator
coverage:  79.2% of statements in consensus/istanbul/validator/random
github-actions[bot] commented 1 year ago

5840 passed, 1 failed, 45 skipped

Test failures:
  TestPrecompileWrappers: e2e_test
Checking getExchangeSpenders. spenders = [0x000000000000000000000000000000000000d028]
Checking medianRate. numerator = 1000000000000000000000000  denominator = 1000000000000000000000000
Checking gas price minimum. cusdValue = 100000000
executing mocha test with /usr/bin/npm run --networkaddr=http://127.0.0.1:32913 test-precompile-wrappers --signerkey=0xadcd29301a496330792adcad1137f35cd18b84d5b0c3dd53ff9e8a9a8e457457

ethersjs-api-check@1.0.0 test-precompile-wrappers /runner/_work/celo-blockchain/celo-blockchain/e2e_test/ethersjs-api-check mocha -r ts-node/register test-precompile-wrappers/*.ts

BLS12-377 1) fpNormal works 2) fpNormal2 works ✔ fpMul works (104ms) ✔ fp2Mul works

  • uncompressing works
  • deserialization works ✔ should g1Add (1673ms) ✔ should g1Mul (1687ms) ✔ should g1MultiExp (2213ms) ✔ should g2Add (1752ms) ✔ should g2Mul (1673ms) ✔ should g2MultiExp (2689ms)
  • should parseG1
  • should serializeG1
  • should parseG2
  • should serializeG2

    BLS12-381 ✔ fpNormal works (42ms) ✔ fpNormal2 works (59ms) ✔ fpMul works (90ms) ✔ fp2Mul works

  • uncompressing works
  • deserialization works ✔ should g1Add (1726ms) ✔ should g1Mul (1626ms) ✔ should g1MultiExp (2194ms) ✔ should g2Add (1740ms) ✔ should g2Mul (1658ms) ✔ should g2MultiExp (3323ms)
  • should parseG1
  • should serializeG1
  • should parseG2
  • should serializeG2

    CIP20 3) should run hashes

    18 passing (26s) 12 pending 3 failing

    1) BLS12-377 fpNormal works: Error: could not decode result data (value="0x", info={ "method": "fpNormalTest", "signature": "fpNormalTest(uint256,uint256)" }, code=BAD_DATA, version=6.6.0) at makeError (node_modules/ethers/src.ts/utils/errors.ts:677:21) at assert (node_modules/ethers/src.ts/utils/errors.ts:694:25) at Interface.decodeFunctionResult (node_modules/ethers/src.ts/abi/interface.ts:916:15) at staticCallResult (node_modules/ethers/src.ts/contract/contract.ts:324:35) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async staticCall (node_modules/ethers/src.ts/contract/contract.ts:281:24) at async Proxy.fpNormalTest (node_modules/ethers/src.ts/contract/contract.ts:329:41)

    2) BLS12-377 fpNormal2 works: Error: could not decode result data (value="0x", info={ "method": "fpNormal2Test", "signature": "fpNormal2Test(uint256,uint256)" }, code=BAD_DATA, version=6.6.0) at makeError (node_modules/ethers/src.ts/utils/errors.ts:677:21) at assert (node_modules/ethers/src.ts/utils/errors.ts:694:25) at Interface.decodeFunctionResult (node_modules/ethers/src.ts/abi/interface.ts:916:15) at staticCallResult (node_modules/ethers/src.ts/contract/contract.ts:324:35) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async staticCall (node_modules/ethers/src.ts/contract/contract.ts:281:24) at async Proxy.fpNormal2Test (node_modules/ethers/src.ts/contract/contract.ts:329:41)

    3) CIP20 should run hashes: Error: could not decode result data (value="0x", info={ "method": "sha2_512", "signature": "sha2_512(bytes)" }, code=BAD_DATA, version=6.6.0) at makeError (node_modules/ethers/src.ts/utils/errors.ts:677:21) at assert (node_modules/ethers/src.ts/utils/errors.ts:694:25) at Interface.decodeFunctionResult (node_modules/ethers/src.ts/abi/interface.ts:916:15) at staticCallResult (node_modules/ethers/src.ts/contract/contract.ts:324:35) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:95:5) at async staticCall (node_modules/ethers/src.ts/contract/contract.ts:281:24) at async Proxy.sha2_512 (node_modules/ethers/src.ts/contract/contract.ts:329:41)

npm ERR! code ELIFECYCLE npm ERR! errno 3 npm ERR! ethersjs-api-check@1.0.0 test-precompile-wrappers: mocha -r ts-node/register test-precompile-wrappers/*.ts npm ERR! Exit status 3 npm ERR! npm ERR! Failed at the ethersjs-api-check@1.0.0 test-precompile-wrappers script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/runner/.npm/_logs/2023-07-03T09_14_55_515Z-debug.log

e2e_test.go:646: </code></pre></td></tr>
This test report was produced by the test-summary action.  Made with ❤️ in Cambridge.