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

Introduce sweat.claim as a Locust workloads #11107

Closed
Tracked by #10981
aborg-dev opened this issue Apr 18, 2024 · 1 comment
Closed
Tracked by #10981

Introduce sweat.claim as a Locust workloads #11107

aborg-dev opened this issue Apr 18, 2024 · 1 comment
Assignees

Comments

@aborg-dev
Copy link
Contributor

At the moment we only have the loadtest setup for the main sweat contract: https://github.com/near/nearcore/blob/71b22e776a161a071a38ed760047cfc2af4ca83c/pytest/tests/loadtest/locust/common/sweat.py

Recently we've been doing optimizations for sweat.claim specifically, so it makes sense to introduce a Locust workload for this.

@mooori
Copy link
Contributor

mooori commented Apr 18, 2024

For reference, this is the method we optimized the prefetcher for in #11094.

aborg-dev added a commit that referenced this issue Apr 24, 2024
This PR introduces sweat.claim contract necessary for #11107 and uses it
to implement sweat::defer_batch and
sweat.claim::get_claimable_balance_for_account calls.

I originally intended to use sweat.claim::claim but it requires the
balance to be locked for some time to be claimed, so to avoid changing
sweat.claim contract, I've used get_claimable_balance_for_account method
instead, which does a similar amount of work and can be called
unconditionally.
github-merge-queue bot pushed a commit that referenced this issue Apr 24, 2024
This PR introduces `sweat.claim` contract necessary for
#11107 and uses it to implement
`sweat::defer_batch` and
`sweat.claim::get_claimable_balance_for_account` calls.

I originally intended to use `sweat.claim::claim` but it requires the
balance to be locked for some time to be claimed, so to avoid changing
`sweat.claim` contract, I've used `get_claimable_balance_for_account`
method instead, which does a similar amount of work and can be called
unconditionally.

You can run this with:

```sh
nearup run localnet --binary-path ../nearcore/target/release/ --num-nodes 1 --num-shards 1 --override
export KEY=~/.near/localnet/node0/validator_key.json
locust -H 127.0.0.1:3030 \
  -f locustfiles/sweat.py \
  --funding-key=$KEY --headless -u 10
```
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

No branches or pull requests

2 participants