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

fix: Hbar usage tracking when transaction is larger than FILE_APPEND_CHUNK_SIZE #2698

Conversation

Ivo-Yankov
Copy link
Collaborator

@Ivo-Yankov Ivo-Yankov commented Jul 12, 2024

Description:

  • Replaces .execute() with .executeAll() for fileAppendTransaciton. This way all transactions are returned in the result. The transaction_fee is summed and subtracted from the remaining Hbar limit in the limiter class.
  • Removes some unused functions from sdkClient.ts.
  • Adds additional acceptance tests for HbarLimiter.
  • Changes the relay operator when running acceptance tests to one of the local-node generated accounts.

Related issue(s):

Fixes #2693

Notes for reviewer:

Checklist

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

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@Ivo-Yankov Ivo-Yankov marked this pull request as draft July 12, 2024 13:57
@Ivo-Yankov Ivo-Yankov self-assigned this Jul 12, 2024
@Ivo-Yankov Ivo-Yankov added bug Something isn't working enhancement New feature or request labels Jul 12, 2024
Copy link

github-actions bot commented Jul 12, 2024

Tests

    2 files  161 suites   12s ⏱️
866 tests 865 ✔️ 1 💤 0
879 runs  878 ✔️ 1 💤 0

Results for commit 4b670dc.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 12, 2024

Acceptance Tests

  17 files  213 suites   32m 8s ⏱️
609 tests 603 ✔️ 4 💤 2
644 runs  638 ✔️ 4 💤 2

Results for commit 4b670dc.

♻️ This comment has been updated with latest results.

@Ivo-Yankov Ivo-Yankov added this to the 0.53.0 milestone Jul 15, 2024
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@Ivo-Yankov Ivo-Yankov marked this pull request as ready for review July 15, 2024 13:15
quiet-node
quiet-node previously approved these changes Jul 15, 2024
Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

LGTM

@quiet-node quiet-node modified the milestones: 0.53.0, 0.52.0 Jul 15, 2024
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Great ideas.
Some questions and clarifications

package.json Show resolved Hide resolved
packages/relay/src/lib/clients/sdkClient.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/clients/sdkClient.ts Show resolved Hide resolved
packages/server/tests/acceptance/rateLimiter.spec.ts Outdated Show resolved Hide resolved
packages/server/tests/acceptance/rateLimiter.spec.ts Outdated Show resolved Hide resolved
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@quiet-node quiet-node modified the milestones: 0.53.0, 0.52.0 Jul 16, 2024
@Ivo-Yankov Ivo-Yankov requested a review from Nana-EC July 16, 2024 18:34
ebadiere
ebadiere previously approved these changes Jul 16, 2024
Copy link
Collaborator

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

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

LG.

Nana-EC
Nana-EC previously approved these changes Jul 16, 2024
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG, unblocking
Minor suggestions

packages/server/tests/localAcceptance.env Outdated Show resolved Hide resolved
@Ivo-Yankov Ivo-Yankov dismissed stale reviews from Nana-EC and ebadiere via 210c592 July 17, 2024 11:33
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Nana-EC
Nana-EC previously approved these changes Jul 17, 2024
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Unblocking but see minor items before merge

package.json Show resolved Hide resolved
packages/relay/src/lib/clients/sdkClient.ts Show resolved Hide resolved
packages/relay/src/lib/clients/sdkClient.ts Outdated Show resolved Hide resolved
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Copy link

sonarcloud bot commented Jul 17, 2024

Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

LGTM

@quiet-node quiet-node merged commit 9ead77c into main Jul 18, 2024
33 checks passed
@quiet-node quiet-node deleted the 2693-use-executeall-instead-of-execute-in-filecreateappend-transactions branch July 18, 2024 00:12
@quiet-node quiet-node modified the milestones: 0.52.0, 0.51.0 Jul 18, 2024
quiet-node pushed a commit that referenced this pull request Jul 18, 2024
…CHUNK_SIZE (#2698)

* fix: use executeAll for fileAppend

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: code cleanup

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: fix typo

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* nit: code smell

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: set lower hbar limit for acceptance tests

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: addressing comments

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: set operator key

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

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

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: remove .only

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: change operator for all tests

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: reverted an unwanted change

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

---------

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@quiet-node quiet-node mentioned this pull request Jul 18, 2024
2 tasks
quiet-node added a commit that referenced this pull request Jul 18, 2024
fix: Hbar usage tracking when transaction is larger than FILE_APPEND_CHUNK_SIZE (#2698)

* fix: use executeAll for fileAppend



* chore: code cleanup



* chore: fix typo



* nit: code smell



* fix: set lower hbar limit for acceptance tests



* fix: addressing comments



* fix: set operator key



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



* chore: remove .only



* fix: change operator for all tests



* chore: reverted an unwanted change



---------

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Co-authored-by: Ivo Yankov <ivo@devlabs.bg>
quiet-node pushed a commit that referenced this pull request Jul 19, 2024
…CHUNK_SIZE (#2698)

* fix: use executeAll for fileAppend

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: code cleanup

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: fix typo

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* nit: code smell

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: set lower hbar limit for acceptance tests

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: addressing comments

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: set operator key

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

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

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: remove .only

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: change operator for all tests

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: reverted an unwanted change

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

---------

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@quiet-node quiet-node mentioned this pull request Jul 19, 2024
2 tasks
quiet-node pushed a commit that referenced this pull request Jul 19, 2024
…CHUNK_SIZE (#2698)

* fix: use executeAll for fileAppend

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: code cleanup

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: fix typo

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* nit: code smell

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: set lower hbar limit for acceptance tests

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: addressing comments

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: set operator key

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

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

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: remove .only

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: change operator for all tests

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: reverted an unwanted change

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

---------

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
quiet-node added a commit that referenced this pull request Jul 19, 2024
fix: Hbar usage tracking when transaction is larger than FILE_APPEND_CHUNK_SIZE (#2698)

* fix: use executeAll for fileAppend



* chore: code cleanup



* chore: fix typo



* nit: code smell



* fix: set lower hbar limit for acceptance tests



* fix: addressing comments



* fix: set operator key



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



* chore: remove .only



* fix: change operator for all tests



* chore: reverted an unwanted change



---------

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Co-authored-by: Ivo Yankov <ivo@devlabs.bg>
ebadiere pushed a commit that referenced this pull request Aug 1, 2024
…CHUNK_SIZE (#2698)

* fix: use executeAll for fileAppend

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: code cleanup

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: fix typo

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* nit: code smell

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: set lower hbar limit for acceptance tests

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: addressing comments

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: set operator key

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

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

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: remove .only

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* fix: change operator for all tests

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

* chore: reverted an unwanted change

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>

---------

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: ebadiere <ebadiere@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use executeAll() instead of execute() in FileCreate/Append transactions
4 participants