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

Enable archiving game data #22

Open
norswap opened this issue May 31, 2023 · 0 comments
Open

Enable archiving game data #22

norswap opened this issue May 31, 2023 · 0 comments

Comments

@norswap
Copy link
Member

norswap commented May 31, 2023

(This will only be relevant in the far future.)

Currently, game data accumulates in the game contract, with a minimal amount of cleanup done. In the future we might wish to archive it somewhere so that appchain validators do not need to know about the old game data.

(Note regarding cleanup: we can safely erase the final game state, but we need to keep at least the list of participants, the winner(s), and the listing of cards used in each player's deck.)

One option would be to (1) compress the game data (e.g. using something like zipped-contracts) and (2) send it to contract storage (e.g. using SSTORE2)

Writing to contract storage not only cost less gas when using the Ethereum gas schedule (though we could depart from that), but also means that validators would only need a single hash for the game assuming they do not care about historical games. To achieve this, we would need to guarantee that either tx cannot call these storage contracts (i.e. it is illegal).

For now this is way way premature optimization, but I think it's pretty neat and wanted to write about it.

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

1 participant