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

chore(connector-go-eth): upgrade web3.js to recent version #2089

Merged
merged 1 commit into from
Nov 26, 2022

Conversation

outSH
Copy link
Contributor

@outSH outSH commented Jun 21, 2022

  • Upgrade web3 package used by go-ethereum-socketio connector from "0.20.7" to "1.8.1"
  • Major cleanup and refactor of go-ethereum-socketio logic,
    without affecting the current functionalities.
  • Add safety checking of method called in web3Eth and contract functions.
    Add tests to check if it works.
  • Add websocket eth RPC support and some helper functions in openethereum-test-ledger.
  • Expose WS RPC in geth-testnet, use this port in sample apps
    (required to monitor new blocks in updated web3.js)
  • Change raw use of sendRawTransaction to sendSignedTransaction in sample apps
    in order to conform to new web3.js version.
  • Add safeStringifyException to cactus-common that can be used by validators
    to sanitize response errors.
  • Refactor socketio-based validators to use safeStringifyException.
  • Adjust connector README files.
  • Improve cleanup after running sample apps
  • Fix discounted-cartrade sample ethereum transfer and checking

Closes #2088

Depends on #2053

Signed-off-by: Michal Bajer michal.bajer@fujitsu.com


Please review only the last commit, the rest are dependencies that should be merged in separate PRs.

@gitguardian
Copy link

gitguardian bot commented Jun 21, 2022

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

Copy link
Contributor

@izuru0 izuru0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@takeutak
Copy link
Contributor

@petermetz @jagpreetsinghsasan (cc: @izuru0)
Could you review this PR?

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@takeutak @outSH Sorry for the slow reviews again. LGTM

@outSH Please fix the conflicts and rebase so that prior to merging it's just the one commit remaining in the PR.

outSH added a commit to outSH/cactus that referenced this pull request Nov 7, 2022
- Add a new package `@hyperledger/cactus-test-verifier-client` for verifier-client stress and
  functional tests that involve multiple packages.
- Add stress test for verifier-client that reports memory usage of repeated operation
  on `cactus-plugin-ledger-connector-go-ethereum-socketio` connector plugin.
- Fix a memory leak in `SocketIOApiClient` - free socket listeners when they are no longer needed.
- Fix `cactus-plugin-ledger-connector-go-ethereum-socketio` - use single a web3 connection
  (with keep-alive/reconnect) instead of spawning new one for each request.
  Previous solution was causing connection issues in stress testing.

Depends on: hyperledger-cacti#2089
Closes: hyperledger-cacti#2189

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
@github-actions
Copy link

This PR/issue depends on:

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@outSH Please squash+rebase+fix the conflicts

@outSH
Copy link
Contributor Author

outSH commented Nov 23, 2022

Please squash+rebase+fix the conflicts

@petermetz Done, I've also done some improvements in sample apps during testing.

Ready for merging

@outSH outSH requested review from petermetz and removed request for sandeepnRES and takeutak November 23, 2022 16:54
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash+rebase+fix the conflicts

@petermetz Done, I've also done some improvements in sample apps during testing.
Ready for merging

@outSH LGTM, thank you very much!

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash+rebase+fix the conflicts

@petermetz Done, I've also done some improvements in sample apps during testing.

Ready for merging

@outSH LGTM, thank you very much!

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@outSH Please resolve the merge conflicts and then pass it back for review.

@outSH outSH force-pushed the go-ethereum-sdk-upgrade_pr branch from db6a2c7 to dcdd9ab Compare November 25, 2022 11:28
@outSH
Copy link
Contributor Author

outSH commented Nov 25, 2022

@petermetz Done, all should work

@outSH outSH requested a review from petermetz November 25, 2022 11:28
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@outSH LGTM, thank you!

- Upgrade web3 package used by go-ethereum-socketio connector from "0.20.7" to "1.8.1"
- Major cleanup and refactor of go-ethereum-socketio logic,
  without affecting the current functionalities.
- Add safety checking of method called in web3Eth and contract functions.
  Add tests to check if it works.
- Add websocket eth RPC support and some helper functions in openethereum-test-ledger.
- Expose WS RPC in geth-testnet, use this port in sample apps
  (required to monitor new blocks in updated web3.js)
- Change raw use of sendRawTransaction to sendSignedTransaction in sample apps
  in order to conform to new web3.js version.
- Add safeStringifyException to cactus-common that can be used by validators
  to sanitize response errors.
- Refactor socketio-based validators to use safeStringifyException.
- Adjust connector README files.
- Improve cleanup after running sample apps
- Fix discounted-cartrade sample ethereum transfer and checking

Closes hyperledger-cacti#2088

Depends on hyperledger-cacti#2053

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
@petermetz petermetz force-pushed the go-ethereum-sdk-upgrade_pr branch from dcdd9ab to 6303544 Compare November 26, 2022 17:17
@petermetz petermetz merged commit 9dd13cb into hyperledger-cacti:main Nov 26, 2022
outSH added a commit to outSH/cactus that referenced this pull request Dec 6, 2022
- Add a new package `@hyperledger/cactus-test-verifier-client` for verifier-client stress and
  functional tests that involve multiple packages.
- Add stress test for verifier-client that reports memory usage of repeated operation
  on `cactus-plugin-ledger-connector-go-ethereum-socketio` connector plugin.
- Fix a memory leak in `SocketIOApiClient` - free socket listeners when they are no longer needed.
- Fix `cactus-plugin-ledger-connector-go-ethereum-socketio` - use single a web3 connection
  (with keep-alive/reconnect) instead of spawning new one for each request.
  Previous solution was causing connection issues in stress testing.

Depends on: hyperledger-cacti#2089
Closes: hyperledger-cacti#2189

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Dec 28, 2022
- Add a new package `@hyperledger/cactus-test-verifier-client` for verifier-client stress and
  functional tests that involve multiple packages.
- Add stress test for verifier-client that reports memory usage of repeated operation
  on `cactus-plugin-ledger-connector-go-ethereum-socketio` connector plugin.
- Fix a memory leak in `SocketIOApiClient` - free socket listeners when they are no longer needed.
- Fix `cactus-plugin-ledger-connector-go-ethereum-socketio` - use single a web3 connection
  (with keep-alive/reconnect) instead of spawning new one for each request.
  Previous solution was causing connection issues in stress testing.

Depends on: hyperledger-cacti#2089
Closes: hyperledger-cacti#2189

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Jan 9, 2023
- Add a new package `@hyperledger/cactus-test-verifier-client` for verifier-client stress and
  functional tests that involve multiple packages.
- Add stress test for verifier-client that reports memory usage of repeated operation
  on `cactus-plugin-ledger-connector-go-ethereum-socketio` connector plugin.
- Fix a memory leak in `SocketIOApiClient` - free socket listeners when they are no longer needed.
- Fix `cactus-plugin-ledger-connector-go-ethereum-socketio` - use single a web3 connection
  (with keep-alive/reconnect) instead of spawning new one for each request.
  Previous solution was causing connection issues in stress testing.

Depends on: hyperledger-cacti#2089
Closes: hyperledger-cacti#2189

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
outSH added a commit to outSH/cactus that referenced this pull request Jan 9, 2023
- Add a new package `@hyperledger/cactus-test-verifier-client` for verifier-client stress and
  functional tests that involve multiple packages.
- Add stress test for verifier-client that reports memory usage of repeated operation
  on `cactus-plugin-ledger-connector-go-ethereum-socketio` connector plugin.
- Fix a memory leak in `SocketIOApiClient` - free socket listeners when they are no longer needed.
- Fix `cactus-plugin-ledger-connector-go-ethereum-socketio` - use single a web3 connection
  (with keep-alive/reconnect) instead of spawning new one for each request.
  Previous solution was causing connection issues in stress testing.

Depends on: hyperledger-cacti#2089
Closes: hyperledger-cacti#2189

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
petermetz pushed a commit that referenced this pull request Jan 17, 2023
- Add a new package `@hyperledger/cactus-test-verifier-client` for verifier-client stress and
  functional tests that involve multiple packages.
- Add stress test for verifier-client that reports memory usage of repeated operation
  on `cactus-plugin-ledger-connector-go-ethereum-socketio` connector plugin.
- Fix a memory leak in `SocketIOApiClient` - free socket listeners when they are no longer needed.
- Fix `cactus-plugin-ledger-connector-go-ethereum-socketio` - use single a web3 connection
  (with keep-alive/reconnect) instead of spawning new one for each request.
  Previous solution was causing connection issues in stress testing.

Depends on: #2089
Closes: #2189

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
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.

chore(connector-go-eth): upgrade web3.js to recent version
5 participants