In order to create history and statistics, I'm struggling to figure out the best way to implement a lookup system. I'm building a game, and right now, my init for the entrant account looks like this:
#[account(
init,
payer = player,
seeds = [b"entrant", player.key().as_ref(), round.key().as_ref()],
bump,
space = 8 + Entrant::MAXIMUM_SIZE)
]
pub entrant: Account<'info, Entrant>,
Since a player can enter more than one round, I'm using both the player key and the round key as the seeds.
However, given the player, I want to be able to somehow lookup all the rounds the player has ever played. I don't want to keep in in one account, as this game can have a lot of rounds and I don't want to run out space.
What would be the best practice in dealing with a situation like this?