near / stakewars-iv

12 stars 9 forks source link

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

Open cuongdcdev opened 6 months ago

cuongdcdev commented 6 months ago

Overview:

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

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:

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
walnut-the-cat commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

@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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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

cuongdcdev commented 6 months ago

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

walnut-the-cat commented 6 months ago

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

walnut-the-cat commented 6 months ago

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 commented 6 months ago

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

walnut-the-cat commented 5 months ago

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 commented 3 months ago

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