-
Notifications
You must be signed in to change notification settings - Fork 285
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
feat(cactus-plugin-ledger-connector-ethereum): update web3js to 4.X #2581
feat(cactus-plugin-ledger-connector-ethereum): update web3js to 4.X #2581
Conversation
...tus-plugin-ledger-connector-ethereum/src/main/typescript/plugin-ledger-connector-ethereum.ts
Dismissed
Show resolved
Hide resolved
...tus-plugin-ledger-connector-ethereum/src/main/typescript/plugin-ledger-connector-ethereum.ts
Dismissed
Show resolved
Hide resolved
...tus-plugin-ledger-connector-ethereum/src/main/typescript/plugin-ledger-connector-ethereum.ts
Dismissed
Show resolved
Hide resolved
Please review only the latest commit (others are dependencies). Note to myself: Update references to geth image once it's available, remove outsh from cspell ignore file. |
...tus-plugin-ledger-connector-ethereum/src/main/typescript/plugin-ledger-connector-ethereum.ts
Outdated
Show resolved
Hide resolved
...tus-plugin-ledger-connector-ethereum/src/main/typescript/plugin-ledger-connector-ethereum.ts
Outdated
Show resolved
Hide resolved
e118466
to
1b0cf5a
Compare
…s prices - Add legacy and EIP1559 gas configuration options to transaction requests. - Legacy gas configuration is updated to EIP1559 using the same logic as web3 libraries. - Update the tests to work with new API. - Added test suite to test new features - `geth-transact-and-gas-fees.test.ts` Depends on: hyperledger-cacti#2581 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
packages/cactus-plugin-ledger-connector-ethereum/src/main/json/openapi.json
Outdated
Show resolved
Hide resolved
1b0cf5a
to
ea65c2d
Compare
This PR/issue depends on:
|
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.
@outSH The cactus-plugin-ledger-connector-ethereum
job is failing, could you please check on it?
Attaching the logs in case they expire in the meantime on the backend:
2023-09-18T12-42-58-cacti-ci-test-connector-ethereum-crash.log
Yes, I will request a review once this PR is ready for merge, didn't address previous comments yet as well |
ea65c2d
to
a7f6a99
Compare
@petermetz Both test suites for this connector should be passing from now on. Sorry for breaking the CI with previous PR, I wasn't checking the test results because I kinda assumed you're doing it anyway :) I should have make sure they pass before even requesting a review. I've also fixed https://github.com/hyperledger/cacti/issues/2594 while working on Now, the shutdown method will first unsubscribe all remaining watchBlocks (in case the client was not disconnected yet), wait for all pending requests to pass and then disconnect the provider. To see request queue I had to access protected field of WS Provider - I will create an issue on web3js github to improve this (either handle it on web3js side or export some public field like One more change I did was adding BTW I wanted to include closing of socketio connections in the connector, but I can't do that since in theory single connection can be used to access multiple plugins (they are api-server responsibility, not connectors). We could use socketio rooms to partition the sockets and move overnship of the active connection to the connector, but I'm not sure if it's beneficial given our time contraint. |
@outSH Hehe, I usually do, rigorously, but with the upcoming v2.0.0 release I've been able to spend a little less time on these things as well TBH. I'm glad you noticed though, thank you again! :-)
Sounds good to me, thank you so much for going the extra mile and investigating the race condition! It makes things easier down the line! It's a reasonable trade-off IMO as well and hopefully web3js will provide some method for us to use that makes this trivial to implement.
LGTM on this too, we can refactor later if it's no longer needed! Thank you!
Let's talk more about this in an issue that I'll try to open (and not forget)! |
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.
LGTM
a7f6a99
to
0dd877b
Compare
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.
LGTM
- Update web3js packages from 1.10 to 4.0.3 in `cactus-plugin-ledger-connector-ethereum` and `cactus-test-plugin-ledger-connector-ethereum`. This allows interacting with most recent geth nodes. - Refactor all ethereum tests. Most of the test cases were duplicated multiple times (between different quorum ledger versions test and deployment methods). I've removed all this duplication while maintaining similar level of test coverage. New tests use Geth test ledger instead of Quorum one. - Add web3js type conversions methods to minimize impact of poor dynamic typing in this early release of 4.X. - Update API. In 4.X all numeric responses has been converted to BigNum. To keep up with this some fields has been changed to string instead of number when necessary. Add some missing fields as well. - Add `estimateMaxFeePerGas` method for estimating current transaction cost. - Fix invalid `runTransact` response type. - Add test script for checking integration with Alchemy that must be executed manually (it's excluded from CI at the moment) - `geth-alchemy-integration-manual-check.test`. Instructions on how to run it has been added to package README. Closes: hyperledger-cacti#2580 Depends on hyperledger-cacti#2535 Depends on hyperledger-cacti#2578 Co-authored-by: Peter Somogyvari <peter.somogyvari@accenture.com> Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com> Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
0dd877b
to
39408c9
Compare
…s prices - Add legacy and EIP1559 gas configuration options to transaction requests. - Legacy gas configuration is updated to EIP1559 using the same logic as web3 libraries. - Update the tests to work with new API. - Added test suite to test new features - `geth-transact-and-gas-fees.test.ts` Depends on: hyperledger-cacti#2581 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
…s prices - Add legacy and EIP1559 gas configuration options to transaction requests. - Legacy gas configuration is updated to EIP1559 using the same logic as web3 libraries. - Update the tests to work with new API. - Added test suite to test new features - `geth-transact-and-gas-fees.test.ts` Depends on: hyperledger-cacti#2581 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
…s prices - Add legacy and EIP1559 gas configuration options to transaction requests. - Legacy gas configuration is updated to EIP1559 using the same logic as web3 libraries. - Update the tests to work with new API. - Added test suite to test new features - `geth-transact-and-gas-fees.test.ts` Depends on: hyperledger-cacti#2581 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
…s prices - Add legacy and EIP1559 gas configuration options to transaction requests. - Legacy gas configuration is updated to EIP1559 using the same logic as web3 libraries. - Update the tests to work with new API. - Added test suite to test new features - `geth-transact-and-gas-fees.test.ts` Depends on: hyperledger-cacti#2581 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
cactus-plugin-ledger-connector-ethereum
andcactus-test-plugin-ledger-connector-ethereum
. This allows interactingwith most recent geth nodes.
(between different quorum ledger versions test and deployment methods). I've removed all this
duplication while maintaining similar level of test coverage.
New tests use Geth test ledger instead of Quorum one.
in this early release of 4.X.
To keep up with this some fields has been changed to string instead of number when necessary.
Add some missing fields as well.
estimateMaxFeePerGas
method for estimating current transaction cost.runTransact
response type.(it's excluded from CI at the moment) -
geth-alchemy-integration-manual-check.test
.Instructions on how to run it has been added to package README.
Future improvements:
Closes https://github.com/hyperledger/cacti/issues/2580
Closes https://github.com/hyperledger/cacti/issues/2656
Closes https://github.com/hyperledger/cacti/issues/2594
Depends on https://github.com/hyperledger/cacti/pull/2535
Depends on https://github.com/hyperledger/cacti/pull/2578
Signed-off-by: Michal Bajer michal.bajer@fujitsu.com