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

[Traffic gen]Traffic Generation Proposal: Stress test the network by simulating mainnet behaviors #60

Open
Tracked by #72
cuongdcdev opened this issue Mar 10, 2024 · 13 comments

Comments

@cuongdcdev
Copy link

cuongdcdev commented Mar 10, 2024

Overview:

We will stress test the network by simulating mainnet behavior, which includes:

  • Performing complex cross-contract calls to change the state of other contracts.
  • Bulk minting and transferring NFTs.
  • Token transfers.

To make it more interesting, after each successful operation, an account will receive 1 point, which will be stored on-chain in our contract. The winners will be those with the most points, and they will receive rewards.

Target traffic volume:

  • We have 5 servers for testing and can ask the community to join the test, so the traffic can be as high as possible, depending on how much NEAR we have (including the RPC infrastructure).
  • We expect to have more than 100,000 transactions per account.

Required tokens for generating traffic:

It's a test environment, so maybe give us 100k of NEAR

Reproduction steps:

Working on the script and the codes will surely give it to the team

Tasks

Preview Give feedback
No tasks being tracked yet.
@cuongdcdev cuongdcdev changed the title Traffic Generation Proposal Traffic Generation Proposal: Stress test the network by simulating mainnet behaviors Mar 10, 2024
@walnut-the-cat
Copy link
Collaborator

Hello @cuongdcdev , thanks for your proposal.

Currently, the engineering team is already mirroring the mainnet traffic for its load tests.

Could you share your detailed plan on how you are going to ask community to join the test and how much load you expect to generate yourself?

Just FYI, we are looking for the load tests that can generate more than several hundreds of transactions per second over reasonable period of time (e.g. several hours)

@cuongdcdev
Copy link
Author

cuongdcdev commented Mar 12, 2024

Hi, @walnut-the-cat! I have a community group, so I can ask them to participate. The group has more than 200 active members, and they will definitely join. The plan is really simple: I will create a list of wallets and give it to the community. There will be a simple web UI for them to use, so they can just open the website and start stress testing the network.

At the end, the top users with high scores will win.

From my side, since I have my own servers, I can spam the network all day.

The expected TPS could be around 100 to 200!

@walnut-the-cat
Copy link
Collaborator

Hi @cuongdcdev , do you think you can generate higher TPS, e.g. above 500? For stress test to work, we are looking for the volume that's on par with what we are seeing during busy hours.

As much as we are excited to the collaborative effort to generate traffic, our main concern is unpredictability of participation. In other words, it's possible that we don't see the amount of traffic we anticipated and that will result in 'failure' of load test, meaning that the reward payout will be largely cut. If you have high confidence in success of this crowd effort and are willing to take the risk, we are happy to discuss with you.

@cuongdcdev
Copy link
Author

@walnut-the-cat, that's kind of high, but I think it's doable from my end only. I have a list of servers, and a TPS around 500 is achievable for me. However, I can't commit if the community will be able to send such a large number of transactions from their end, as they are only using personal devices.

@walnut-the-cat
Copy link
Collaborator

Hello @cuongdcdev ,

To be more clear, we do not need 500+ tps for a long time. several hours will be enough. If you can do something like an hour of 500+ tps and 200-300 tps for several hours before and after the peak block, that may work as well.

Besides, could you able to explain more about what kind of traffics you expect to generate and how the flow would look like? When you say top users with high scores will win , it sounds like inscription token (or possibly NFT minting), but I want to understand better

@cuongdcdev
Copy link
Author

Hi @walnut-the-cat
Sure I think i can do that, 500+ tps at peak during an hour and around 200 - 300 tps before and after.

About the traffic flow, it's like for each of the transactions, the account that calls the transaction will get 1 point.
For example, the a.stateless account will get +1 point after each token transfer / NFT transfer / NFT minting and there are unlimited points each account can earn.

So after the game is over, the top highest point accounts will be selected as winners and I have a reward for them.

@walnut-the-cat
Copy link
Collaborator

walnut-the-cat commented Mar 14, 2024

I see. so a user can choose what kind of txn they want to generate and traffic sequence can be different per user

@cuongdcdev
Copy link
Author

@walnut-the-cat the plan is to allow users to generate all kinds of traffic, so both nft / tx transfer...

@walnut-the-cat
Copy link
Collaborator

Thanks for clarification. we will take the proposal to our side, assess, and share the initial conclusion early next week!

@walnut-the-cat
Copy link
Collaborator

Happy Monday @cuongdcdev As promised, we are sharing the reward estimate.

FYI, as the team needs more time to make proper optimization/stabilization before traffic generation can start, it's likely that we will extend the stake wars to April. It means that timing of the load test will need to be coordinated with the team and is likely to be in April. If you have any further questions/comment, please let us know!

Baseline reward amount

500 NEAR

Volume multiplier

1x, assuming the proposer can accomplish 500+ tps at peak during an hour and around 200 - 300 tps before and after

Novelty multiplier

1x.

First of all, the proposed load types are within the range of the traditional load types we have tested ourselves (LINK). So if the outcome traffic pattern is skewed towards one specific transactions (e.g. 80% of generated traffic is nft transfer) the multiplier will be 0.75x.

Yet, if we can make sure the traffic patterns are more evenly distributed (so we can ensure diversity), with multi user participation, your proposal deserves higher multiplier, thus we concluded with 1x.

Outcome multiplier

1x, assuming the proposer can generated the traffic successfully at the coordinated time.

Reward estimate upon successful execution

500 NEAR (500 NEAR * 1 * 1 * 1)

@cuongdcdev
Copy link
Author

@walnut-the-cat thank you, I'm working on the script now! See you in April!

@walnut-the-cat walnut-the-cat changed the title Traffic Generation Proposal: Stress test the network by simulating mainnet behaviors [Traffic gen]Traffic Generation Proposal: Stress test the network by simulating mainnet behaviors Apr 10, 2024
@walnut-the-cat
Copy link
Collaborator

Hello @cuongdcdev

We are aiming to restart currently paused StakeWars IV near end of May after on-going internal tests. (Current ETA: May 27th). Near mid-May, one of the team members will reach out to you on this issue to coordinate the schedule.

Again, I apologize for the delay. We will make sure that your time and effort are acknowledge and compensated properly.

@telezhnaya
Copy link
Contributor

Hey @cuongdcdev,
Could you please ping me on telegram? https://t.me/telezhnaya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants