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

Add rate limit for game actions #378

Merged
merged 7 commits into from
Oct 3, 2023
Merged

Add rate limit for game actions #378

merged 7 commits into from
Oct 3, 2023

Conversation

loothero
Copy link
Contributor

@loothero loothero commented Oct 3, 2023

  • Add rate limit for game actions
    Target rate limit is 2 actions per minute. This is accomplished by dynamically calculating the speed of blocks starknet is producing and then dynamically setting the per block limit. This will significantly decrease the power of bots and force them to operate in at the human time scale.

  • Dynamic game entropy rotation entropy
    The rotation interval for the game entropy is now based on the speed of starknet blocks with the target time 10 mins
    Player idle death penalty is one block less than the above rotation period, to require players to make a move before the outcome changes

The combination of these two features significantly decreases the power of bots by subjecting them to the human timespace and forcing them to deal with numerous global game entropy rotations.

* This reduces maximum upgradable value for stats from 31 to 15
* Note this does not include stat boosts from items as those are applied dynamically
* We can/should also apply the starting stats dynamically so these don't consume bits
* This change frees up 6 bits which will be used for rate limiting actions which will significantly reduce advantage bots have
* reduces storage entropy hash from 128 to 123 bits
* 64 bits for block number
* 64 bits for block timestamp
* adds actions_per_block to Adventurer which is stored via 4 bits (0-15)
* rate limit is dynamic based on starknet block speed
* target is two actions per minute
@loothero loothero added the enhancement New feature or request label Oct 3, 2023
@loothero loothero self-assigned this Oct 3, 2023
@vercel
Copy link

vercel bot commented Oct 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
loot-survivor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2023 3:46am

@loothero loothero changed the title Rate limit actions Add rate limit for game actions Oct 3, 2023
@loothero loothero merged commit cc9fb5a into main Oct 3, 2023
7 checks passed
@loothero loothero deleted the rate-limit-actions branch October 3, 2023 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant