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

2755 hbar operator fees #2779

Closed
wants to merge 38 commits into from
Closed

Conversation

ebadiere
Copy link
Collaborator

@ebadiere ebadiere commented Aug 1, 2024

Cherry pick #2755

Description:

Related issue(s):

Fixes #

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@ebadiere ebadiere self-assigned this Aug 1, 2024
@ebadiere ebadiere added the bug Something isn't working label Aug 1, 2024
@ebadiere ebadiere added this to the 0.53.0 milestone Aug 1, 2024
quiet-node and others added 17 commits August 1, 2024 08:15
…ue (#2633)

* fix: net_version now reads chainId from config and return decimal value

Signed-off-by: Logan Nguyen <[email protected]>

* fix: fixed regex pattern for postman test

Signed-off-by: Logan Nguyen <[email protected]>

---------

Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Swirlds Automation <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* fix: dapp-example/package.json & dapp-example/package-lock.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-WS-7266574

Signed-off-by: Logan Nguyen <[email protected]>

* fix: migrated ethersv5 to ethersv6 in dapp-example

Signed-off-by: Logan Nguyen <[email protected]>

* dep: bumped packages

Signed-off-by: Logan Nguyen <[email protected]>

* chore: fix dependencies

Signed-off-by: nikolay <[email protected]>

* chore: edit sleeps

Signed-off-by: nikolay <[email protected]>

* chore: bump timeout

Signed-off-by: nikolay <[email protected]>

* chore: revert spec

Signed-off-by: nikolay <[email protected]>

* chore: fix _signingKey

Signed-off-by: nikolay <[email protected]>

* chore: edit tests

Signed-off-by: nikolay <[email protected]>

* chore: edit events

Signed-off-by: nikolay <[email protected]>

* chore: test

Signed-off-by: nikolay <[email protected]>

---------

Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: nikolay <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: Logan Nguyen <[email protected]>
Co-authored-by: nikolay <[email protected]>
Signed-off-by: ebadiere <[email protected]>
fix: upgrade web3 from 4.8.0 to 4.9.0

Snyk has created this PR to upgrade web3 from 4.8.0 to 4.9.0.

See this package in npm:
web3

See this project in Snyk:
https://app.snyk.io/org/json-rpc-relay/project/9e95a688-4e8c-4400-bbd9-181a47c69778?utm_source=github&utm_medium=referral&page=upgrade-pr

Signed-off-by: ebadiere <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Signed-off-by: ebadiere <[email protected]>
Changes current logic of getFilterChanges, so it considers changes from internal cache as well

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: ebadiere <[email protected]>
…2657)

* fix: Added metrics around the HBar rate limiter to better track the
HBar rate limiting.

Signed-off-by: ebadiere <[email protected]>

* Update packages/relay/src/lib/hbarlimiter/index.ts

Co-authored-by: Nana Essilfie-Conduah <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>

* fix: Removed the shouldLimit called counter.

Signed-off-by: ebadiere <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Co-authored-by: Nana Essilfie-Conduah <[email protected]>
Signed-off-by: ebadiere <[email protected]>
)

fix: eth_getBlockTransactionCountByNumber is not supported in wss, should be treated as such

Signed-off-by: Mariusz Jasuwienas <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* fix: upgrade @hashgraph/sdk from 2.44.0 to 2.46.0

Snyk has created this PR to upgrade @hashgraph/sdk from 2.44.0 to 2.46.0.

See this package in npm:
@hashgraph/sdk

See this project in Snyk:
https://app.snyk.io/org/json-rpc-relay/project/935f0190-a061-4f84-9ff5-5e5a6754ca16?utm_source=github&utm_medium=referral&page=upgrade-pr

Signed-off-by: ebadiere <[email protected]>

* fix: issue when trying to perform transaction (#2663)

Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: ebadiere <[email protected]>

* fix: Adds usage of internal cache for getFilterChanges (#2668)

Changes current logic of getFilterChanges, so it considers changes from internal cache as well

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: ebadiere <[email protected]>

* fix: Added metrics around the HBar rate limiter to better track the (#2657)

* fix: Added metrics around the HBar rate limiter to better track the
HBar rate limiting.

Signed-off-by: ebadiere <[email protected]>

* Update packages/relay/src/lib/hbarlimiter/index.ts

Co-authored-by: Nana Essilfie-Conduah <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>

* fix: Removed the shouldLimit called counter.

Signed-off-by: ebadiere <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Co-authored-by: Nana Essilfie-Conduah <[email protected]>
Signed-off-by: ebadiere <[email protected]>

* fix:  eth_getBlockTransactionCountByNumber is not supported in wss (#2650)

fix: eth_getBlockTransactionCountByNumber is not supported in wss, should be treated as such

Signed-off-by: Mariusz Jasuwienas <[email protected]>
Signed-off-by: ebadiere <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Signed-off-by: Mariusz Jasuwienas <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: Georgi Lazarov <[email protected]>
Co-authored-by: konstantinabl <[email protected]>
Co-authored-by: Eric Badiere <[email protected]>
Co-authored-by: Nana Essilfie-Conduah <[email protected]>
Co-authored-by: Mariusz Jasuwienas <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* fix: estimate_gas doesn't reflect changes in mirror-node

Signed-off-by: Victor Yanev <[email protected]>

* fix: estimate_gas doesn't reflect changes in mirror-node

Signed-off-by: Victor Yanev <[email protected]>

* fix: tests in eth_estimateGas.spec.ts

Signed-off-by: Victor Yanev <[email protected]>

* Merge branch 'refs/heads/main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	packages/relay/src/lib/eth.ts

* chore: simplify isNonZeroValue condition

Signed-off-by: Victor Yanev <[email protected]>

* chore: add docs + fix compilation errors

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix remaining sonar issues

Signed-off-by: Victor Yanev <[email protected]>

* Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	packages/relay/src/lib/eth.ts
#	packages/relay/tests/lib/eth/eth_call.spec.ts
#	packages/relay/tests/lib/eth/eth_estimateGas.spec.ts

* chore: revert changes to EthImpl#call

Signed-off-by: Victor Yanev <[email protected]>

* Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	packages/relay/src/lib/precheck.ts

* Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	packages/relay/src/lib/clients/mirrorNodeClient.ts

---------

Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* chore: update copyrights

Signed-off-by: georgi-l95 <[email protected]>

* fix: package.json in subgraph example

Signed-off-by: georgi-l95 <[email protected]>

---------

Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* chore: fix formatter

Signed-off-by: nikolay <[email protected]>

* chore: fix expected test result

Signed-off-by: nikolay <[email protected]>

---------

Signed-off-by: nikolay <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* test: waffle tool example

Signed-off-by: Mariusz Jasuwienas <[email protected]>

* test: adding missing new line

Signed-off-by: Mariusz Jasuwienas <[email protected]>

* fix: applying pr suggestions

Signed-off-by: Mariusz Jasuwienas <[email protected]>

* fix: applying pr suggestions

Signed-off-by: Mariusz Jasuwienas <[email protected]>

---------

Signed-off-by: Mariusz Jasuwienas <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* chore: Increase batch request limit

Signed-off-by: Victor Yanev <[email protected]>

* fix: handle undefined method limit configuration

Signed-off-by: Victor Yanev <[email protected]>

* fix: handle undefined method limit configuration

Signed-off-by: Victor Yanev <[email protected]>

* chore: add types to KoaJsonRpc class

Signed-off-by: Victor Yanev <[email protected]>

* chore: revert changes to RpcResponse.ts

Signed-off-by: Victor Yanev <[email protected]>

* chore: remove batchMaxCount option for ethers.JsonRpcProvider in relayClient.ts

Signed-off-by: Victor Yanev <[email protected]>

* chore: remove batchMaxCount option for ethers.JsonRpcProvider in servicesClient.ts

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix nonce pre-check test in rpc_batch1.spec.ts

Signed-off-by: Victor Yanev <[email protected]>

* chore: clean-up KoaJsonRpc

Signed-off-by: Victor Yanev <[email protected]>

* chore: remove unused constants

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix warnings

Signed-off-by: Victor Yanev <[email protected]>

* chore: extract helper methods in utils.ts

Signed-off-by: Victor Yanev <[email protected]>

* chore: add return types to useRpc() and rpcApp()

Signed-off-by: Victor Yanev <[email protected]>

* chore: formatting

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix code smells

Signed-off-by: Victor Yanev <[email protected]>

* chore: add interface IJsonRpcRequest

Signed-off-by: Victor Yanev <[email protected]>

* chore: remove batch request rate limit in webSocketServer.ts

Signed-off-by: Victor Yanev <[email protected]>

* test: fix rateLimiter.spec.ts

Signed-off-by: Victor Yanev <[email protected]>

* test: remove unused variable

Signed-off-by: Victor Yanev <[email protected]>

* chore: use BATCH_REQUEST_METHOD_NAME for ctx.state.methodName

Signed-off-by: Victor Yanev <[email protected]>

---------

Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: ebadiere <[email protected]>
…ng smart contracts (#2647)

* feat: allowed eth_call to accept null/empty tx.to to simulate deploying smart contracts

Signed-off-by: Logan Nguyen <[email protected]>

* fix: added support for `to` being empty or undefined

Signed-off-by: Logan Nguyen <[email protected]>

* fix: removed unnecessary test cases

Signed-off-by: Logan Nguyen <[email protected]>

---------

Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* fix: packages/server/package.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-SERIALIZEJAVASCRIPT-6147607

Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>

* fix: update package-lock.json

Signed-off-by: Logan Nguyen <[email protected]>

* fix: removed describe import in validator.spec.ts

Signed-off-by: Logan Nguyen <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: Logan Nguyen <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* fix: upgrade co-body from 6.1.0 to 6.2.0

Snyk has created this PR to upgrade co-body from 6.1.0 to 6.2.0.

See this package in npm:
co-body

See this project in Snyk:
https://app.snyk.io/org/json-rpc-relay/project/4e06111f-ea93-4504-8fd5-38a6c521805f?utm_source=github&utm_medium=referral&page=upgrade-pr

Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>

* fix: update package-lock.json

Signed-off-by: Logan Nguyen <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: Logan Nguyen <[email protected]>
Signed-off-by: ebadiere <[email protected]>
natanasow and others added 21 commits August 1, 2024 08:15
…2692)

* chore: add buffer

Signed-off-by: nikolay <[email protected]>

* chore: edit tests in order to fix code duplication warning

Signed-off-by: nikolay <[email protected]>

* chore: move the calculations to formatter.ts

Signed-off-by: nikolay <[email protected]>

* chore: fix readme

Signed-off-by: nikolay <[email protected]>

* chore: add utils class

Signed-off-by: nikolay <[email protected]>

* chore: fix sonarcloud issue

Signed-off-by: nikolay <[email protected]>

---------

Signed-off-by: nikolay <[email protected]>
Signed-off-by: ebadiere <[email protected]>
…tional HBar spend visuals. (#2658)

* feat: Checking in the grafana dashboard into the reposity.

Signed-off-by: ebadiere <[email protected]>

* feat:  Checked in the latest Grafana dashboards

Signed-off-by: ebadiere <[email protected]>

feat: Include the deleted files.

Signed-off-by: ebadiere <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>
Bump versions for v0.53.0-SNAPSHOT

Signed-off-by: Swirlds Automation <[email protected]>
Signed-off-by: ebadiere <[email protected]>
…CHUNK_SIZE (#2698)

* fix: use executeAll for fileAppend

Signed-off-by: Ivo Yankov <[email protected]>

* chore: code cleanup

Signed-off-by: Ivo Yankov <[email protected]>

* chore: fix typo

Signed-off-by: Ivo Yankov <[email protected]>

* nit: code smell

Signed-off-by: Ivo Yankov <[email protected]>

* fix: set lower hbar limit for acceptance tests

Signed-off-by: Ivo Yankov <[email protected]>

* fix: addressing comments

Signed-off-by: Ivo Yankov <[email protected]>

* fix: set operator key

Signed-off-by: Ivo Yankov <[email protected]>

* test: check if switching operator in relay restart breaks sdkClient

Signed-off-by: Ivo Yankov <[email protected]>

* chore: remove .only

Signed-off-by: Ivo Yankov <[email protected]>

* fix: change operator for all tests

Signed-off-by: Ivo Yankov <[email protected]>

* chore: reverted an unwanted change

Signed-off-by: Ivo Yankov <[email protected]>

---------

Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: ebadiere <[email protected]>
…cuteTransaction and deleteFile (#2714)

* fix: captured transaction fee in metrics and hbar limiter class for executeTransaction

Signed-off-by: Logan Nguyen <[email protected]>

* fix: captured transaction fee in hbar limiter class for deleteFile

Signed-off-by: Logan Nguyen <[email protected]>

* fix: improved the logic of capturing transaction fees to metrics in executeTransaction

Signed-off-by: Logan Nguyen <[email protected]>

* fix: improved error handling logic for sendRawTransaction

Signed-off-by: Logan Nguyen <[email protected]>

fix: added polling logic to retrieve updated account nonce for WRONG_NONCE error handler

Signed-off-by: Logan Nguyen <[email protected]>

* fix: removed non-existed NEXT_STORAGE_CONTRACT_UPDATE singature hash

Signed-off-by: Logan Nguyen <[email protected]>

* fix: added logic to throw WRONG_NONCE error

Signed-off-by: Logan Nguyen <[email protected]>

* fix: tweaked and reused executeGetTransactionRecord

Signed-off-by: Logan Nguyen <[email protected]>

* fix: fixed http rate limiter failing test

Signed-off-by: Logan Nguyen <[email protected]>

* fix: reverted shouldLimit check

Signed-off-by: Logan Nguyen <[email protected]>

---------

Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* chore: return logs bloom

Signed-off-by: nikolay <[email protected]>

* chore: fix assertions

Signed-off-by: nikolay <[email protected]>

---------

Signed-off-by: nikolay <[email protected]>
Signed-off-by: ebadiere <[email protected]>
#2690)

* fix: Updated the account from the 0.0.2 account to an account from the local node to track
transaction costs.

Signed-off-by: ebadiere <[email protected]>

* fix: Turning off test to potentially get through CI.
Opened issue: #2700

Signed-off-by: ebadiere <[email protected]>

* fix: WIP: Pushing up to collaborate

Signed-off-by: ebadiere <[email protected]>

fix: Updated the private key to the hex ECDSA value.

Signed-off-by: ebadiere <[email protected]>

fix: Bumped up the gasLimit to the required amount to activate a hollow account.

Signed-off-by: ebadiere <[email protected]>

* fix:  Added key format support to the serviceClient.

Signed-off-by: ebadiere <[email protected]>

* fix: Extracted the createPrivateKeyBasedOnFormat(key) to the Utils class.

Signed-off-by: ebadiere <[email protected]>

* fix: Updated import of createPrivateKeyBasedOnFormat from Utils.

Signed-off-by: ebadiere <[email protected]>

* fix: Removed memory leak check.  PR 26954 addresses memory leaks.

Signed-off-by: ebadiere <[email protected]>

* fix:  Removed null test because an env var which is a string cannot be
set to null

Signed-off-by: ebadiere <[email protected]>

* fix: Removed the comment in the GH workflow

Signed-off-by: ebadiere <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Signed-off-by: ebadiere <[email protected]>
fix: upgrade web3 from 4.9.0 to 4.10.0

Snyk has created this PR to upgrade web3 from 4.9.0 to 4.10.0.

See this package in npm:
web3

See this project in Snyk:
https://app.snyk.io/org/json-rpc-relay/project/9e95a688-4e8c-4400-bbd9-181a47c69778?utm_source=github&utm_medium=referral&page=upgrade-pr

Signed-off-by: ebadiere <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* test: add additional hbar limiter tests

Signed-off-by: georgi-l95 <[email protected]>

* chore: remove duplicate variable

Signed-off-by: georgi-l95 <[email protected]>

* chore: update tests after merge from main

Signed-off-by: Victor Yanev <[email protected]>

* chore: move hbar limiter tests to separate job

Signed-off-by: Victor Yanev <[email protected]>

* chore: small fix

Signed-off-by: Victor Yanev <[email protected]>

* chore: small fix

Signed-off-by: Victor Yanev <[email protected]>

* chore: do not restart relay and create accounts if `!global.relayIsLocal`

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix tests

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix tests

Signed-off-by: Victor Yanev <[email protected]>

* chore: restore rateLimiter tests to be the same as before

Signed-off-by: Victor Yanev <[email protected]>

* test: improved assertions to compare the cost of the transaction and the remaining hbar limiter balanace

Signed-off-by: Victor Yanev <[email protected]>

* test: adjust expected costs

Signed-off-by: Victor Yanev <[email protected]>

* test: add `needs: hbarlimiter` to `publish_results`

Signed-off-by: Victor Yanev <[email protected]>

* test: change delta to 0.1% tolerance

Signed-off-by: Victor Yanev <[email protected]>

* test: extract common logic for checking remaining hbar limit

Signed-off-by: Victor Yanev <[email protected]>

---------

Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Co-authored-by: Victor Yanev <[email protected]>
Signed-off-by: ebadiere <[email protected]>
…void capturing metrics twice (#2742)

Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* test: added E2E test fir preemtive rate limit

Signed-off-by: Logan Nguyen <[email protected]>

* Update hbarLimiter.spec.ts

Signed-off-by: Logan Nguyen <[email protected]>

---------

Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* test: expand integration tests for SDK client

Signed-off-by: Victor Yanev <[email protected]>

* chore: minor improvements to sdkClient.ts

Signed-off-by: Victor Yanev <[email protected]>

* fix: typescript error

Signed-off-by: Victor Yanev <[email protected]>

* fix: simplify test data

Signed-off-by: Victor Yanev <[email protected]>

* chore: formatting

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix typescript errors and warnings

Signed-off-by: Victor Yanev <[email protected]>

* chore: optimize imports

Signed-off-by: Victor Yanev <[email protected]>

* chore: address comments

Signed-off-by: Victor Yanev <[email protected]>

* chore: improve readability of tests

Signed-off-by: Victor Yanev <[email protected]>

* test: fix wrong MIRROR_NODE_LIMIT_PARAM in relay tests

Signed-off-by: Victor Yanev <[email protected]>

* fix: wrong env file loaded

Signed-off-by: Victor Yanev <[email protected]>

* test: remove hardcoded usages of MIRROR_NODE_LIMIT_PARAM in relay tests

Signed-off-by: Victor Yanev <[email protected]>

* test: revert changes to rpc_batch1.spec.ts

Signed-off-by: Victor Yanev <[email protected]>

* chore: remove unused import

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix test after merge

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix test after merge

Signed-off-by: Victor Yanev <[email protected]>

* chore: revert changes to usages of MIRROR_NODE_LIMIT_PARAM

Signed-off-by: Victor Yanev <[email protected]>

* chore: revert changes to usages of MIRROR_NODE_LIMIT_PARAM

Signed-off-by: Victor Yanev <[email protected]>

---------

Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* chore: refactor eth.ts

Signed-off-by: nikolay <[email protected]>

* chore: bump hedera-local version

Signed-off-by: nikolay <[email protected]>

---------

Signed-off-by: nikolay <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* chore: Implement memory leak detection in tests

Signed-off-by: Victor Yanev <[email protected]>

* chore: Implement memory leak detection in tests

Signed-off-by: Victor Yanev <[email protected]>

* chore: Implement memory leak detection in tests

Signed-off-by: Victor Yanev <[email protected]>

* chore: Implement memory leak detection in tests

Signed-off-by: Victor Yanev <[email protected]>

* chore: Implement memory leak detection in tests

Signed-off-by: Victor Yanev <[email protected]>

* chore: add docs

Signed-off-by: Victor Yanev <[email protected]>

* chore: fix sonar issues

Signed-off-by: Victor Yanev <[email protected]>

* chore: formatting

Signed-off-by: Victor Yanev <[email protected]>

* chore: small fix

Signed-off-by: Victor Yanev <[email protected]>

* chore: trace GC and write snapshot if memory leak > 0.5 MB

Signed-off-by: Victor Yanev <[email protected]>

* chore: revert false changes to eth.ts

Signed-off-by: Victor Yanev <[email protected]>

* chore: optimize code

Signed-off-by: Victor Yanev <[email protected]>

* Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	package-lock.json
#	package.json
#	packages/server/tsconfig.json

* fix: Do not write heap snapshots for acceptance tests

Signed-off-by: Victor Yanev <[email protected]>

* fix: add TODO for removing --trace_gc flag

Signed-off-by: Victor Yanev <[email protected]>

* test: add github comment in cases a test is having memory leaks

Signed-off-by: Victor Yanev <[email protected]>

* test: add github context env variables

Signed-off-by: Victor Yanev <[email protected]>

* test: extract common logic for github api calls

Signed-off-by: Victor Yanev <[email protected]>

* test: console.debug -> console.log for successful PR comments

Signed-off-by: Victor Yanev <[email protected]>

* test: fix request to github API

Signed-off-by: Victor Yanev <[email protected]>

* Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	packages/server/tests/acceptance/index.spec.ts

* Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test

Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	packages/server/tests/acceptance/index.spec.ts

* fix: request to github API

Signed-off-by: Victor Yanev <[email protected]>

* chore: add upload heap snapshots step in github workflow for acceptance and integration tests

Signed-off-by: Victor Yanev <[email protected]>

* fix: add `subject_type: file` to github request for adding comment on PR

Signed-off-by: Victor Yanev <[email protected]>

* fix: fix path in request to github API

Signed-off-by: Victor Yanev <[email protected]>

* chore: extract github request logic in new file - githubClient.ts

Signed-off-by: Victor Yanev <[email protected]>

* fix: path of upload-artifact action for uploading heap snapshots

Signed-off-by: Victor Yanev <[email protected]>

* fix: requests in githubClient.ts

Signed-off-by: Victor Yanev <[email protected]>

* fix: requests in githubClient.ts

Signed-off-by: Victor Yanev <[email protected]>

* fix: format message of github-actions[bot]

Signed-off-by: Victor Yanev <[email protected]>

* fix: format message of github-actions[bot]

Signed-off-by: Victor Yanev <[email protected]>

* chore: remove unused github context env variable

Signed-off-by: Victor Yanev <[email protected]>

* chore: formatting

Signed-off-by: Victor Yanev <[email protected]>

* chore: formatting

Signed-off-by: Victor Yanev <[email protected]>

* chore: formatting

Signed-off-by: Victor Yanev <[email protected]>

* fix: `formatBytes` returns `NaN undefined` when `0` is passed to it

Signed-off-by: Victor Yanev <[email protected]>

* fix: `formatBytes` returns `NaN undefined` when negative number is passed to it

Signed-off-by: Victor Yanev <[email protected]>

* fix: predicate for updating existing comment

Signed-off-by: Victor Yanev <[email protected]>

* fix: remove unused constant + temporary console logs

Signed-off-by: Victor Yanev <[email protected]>

* fix: make memory leak report more descriptive

Signed-off-by: Victor Yanev <[email protected]>

* chore: remove unnecessary console logs

Signed-off-by: Victor Yanev <[email protected]>

* chore: reduce MEMORY_LEAK_SNAPSHOT_THRESHOLD to 500 KB

Signed-off-by: Victor Yanev <[email protected]>

* fix: update logic for detecting memory leak based on heap size threshold

Signed-off-by: Victor Yanev <[email protected]>

* fix: add separate threshold for taking heap snapshots

Signed-off-by: Victor Yanev <[email protected]>

* fix: set `WRITE_SNAPSHOT_ON_MEMORY_LEAK` to be `false` by default

Signed-off-by: Victor Yanev <[email protected]>

* test: add warm-up phase to memory leak detection

Signed-off-by: Victor Yanev <[email protected]>

* chore: revert changes to rpc_batch1.spec.ts

Signed-off-by: Victor Yanev <[email protected]>

---------

Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Co-authored-by: Eric Badiere <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* chore: remove env

Signed-off-by: nikolay <[email protected]>

* chore: modify test

Signed-off-by: nikolay <[email protected]>

---------

Signed-off-by: nikolay <[email protected]>
Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Swirlds Automation <[email protected]>
Signed-off-by: ebadiere <[email protected]>
#2776)

feat: reused executetransaction for methods in sdkclient and improved logging (#2749)

* fix: reused executeTransaction() in deleteFile() method

* fix: reworked executeTransaction() to accept executeAll

* feat: fix: reused executeTransaction() in fileCreate() method

* fix: removed check rate limit in executeGetTransactionRecord

* fix: fixed SDK HBAR limiter tests

* fix: reverted rework executeTransaction()

* fix: reworked formatRequestIdMessage

* feat: added executeAllTransaction() method

* fix: made shouldLimit optional in executeTransaction()

* Update packages/relay/src/lib/clients/sdkClient.ts

* fix: addressed comments

* fix: extracted handleExecuteAllError()

* fix: renamed handleExecuteAllError to getTransactionMetrics and reuse it in executeTransaction

---------

Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Co-authored-by: Logan Nguyen <[email protected]>
Co-authored-by: Victor Yanev <[email protected]>
Signed-off-by: ebadiere <[email protected]>
Signed-off-by: Swirlds Automation <[email protected]>
Signed-off-by: ebadiere <[email protected]>
* fix: reduce hbar limit only by operator fees

Signed-off-by: Ivo Yankov <[email protected]>

* chore: update expected values

Signed-off-by: Ivo Yankov <[email protected]>

* chore: fix code smells

Signed-off-by: Ivo Yankov <[email protected]>

* nit: re-trigger ci

Signed-off-by: Ivo Yankov <[email protected]>

* chore: addressing comments

Signed-off-by: Ivo Yankov <[email protected]>

* fix: hbar limit error handle

Signed-off-by: Ivo Yankov <[email protected]>

* fix: reduce test flakiness

Signed-off-by: Ivo Yankov <[email protected]>

* fix: reduce test flakiness

Signed-off-by: Ivo Yankov <[email protected]>

* nit: update comment

Signed-off-by: Ivo Yankov <[email protected]>

* fix: unit test mocks

Signed-off-by: Ivo Yankov <[email protected]>

* fix: update assertions and mocks

Signed-off-by: Ivo Yankov <[email protected]>

---------

Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Co-authored-by: Eric Badiere <[email protected]>
Signed-off-by: ebadiere <[email protected]>
@ebadiere
Copy link
Collaborator Author

ebadiere commented Aug 1, 2024

Replaced by: #2781

@ebadiere ebadiere closed this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

9 participants