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

Time #352

Closed
0xJepsen opened this issue May 28, 2023 · 7 comments · Fixed by #409 or #378
Closed

Time #352

0xJepsen opened this issue May 28, 2023 · 7 comments · Fixed by #409 or #378
Assignees

Comments

@0xJepsen
Copy link
Collaborator

0xJepsen commented May 28, 2023

Okay i'm revisiting this after doing some more research on the libraries available that we could use for this. After some digging and reviewing a few libraries with @0xEstelle we have concluded that using desim would be the best approach. Desim is entirely native to rust but inspired by simpy which we are already familiar with. I think it is a great solution to desire to integrate a notion of relative time into our simulations.

@0xJepsen 0xJepsen added this to the Aika milestone May 28, 2023
@0xJepsen
Copy link
Collaborator Author

I think we will want to maybe first take a look here https://github.com/primitivefinance/arbiter/blob/83e61128031d7a223942eb96c663f87defe50683/lib/simulate/src/environment/sim_environment.rs#L15-L21 and see where we can fit this into our environment and what are all the processes we need to integrate into it to make things happen.

@0xJepsen 0xJepsen removed this from the Time milestone Jun 28, 2023
@0xJepsen
Copy link
Collaborator Author

Okay, so after looking more deeply into desim and getting some input on findings. We have decided that it may be more verbos than what we need and add unnecessary complexity for the core library and for our users. We have decided to build a time module to function as a time oracle instead. This time oracle will sample from the Poisson distribution configured with a "expected number of occurrences" of discrete events per block, where a discrete event is a simulation related transaction. For example in uniswap, a block can have an average number of uniswap related transactions (or discrete events) per block. This allows us to have an abstract notion of time in our simulations without needing to occupy or have a notion of blocksize in the simulation.

The planed implementation would be an environment configuration that would in environment.run() would check wether or not it would be needed to update the block, and would update the timestamp. The block update check would depend on the distribution sampling. We would want to expose the environment configuration to the end users to allow them to set an expected number of occurrences per block given their simulation needs.

@0xJepsen 0xJepsen linked a pull request Aug 3, 2023 that will close this issue
@0xJepsen 0xJepsen linked a pull request Aug 3, 2023 that will close this issue
1 task
@Autoparallel
Copy link
Collaborator

@0xJepsen Can we relink this issue now and consider closing it with a bit of updates to our block incrementing implementation?

@0xJepsen
Copy link
Collaborator Author

yep, its linked! Do you specifically mean adding block-times in a similar way?

@Autoparallel
Copy link
Collaborator

@0xJepsen I'm a bit confused, why did we close this issue? It has not been addressed yet. We still have no way to update or track block time in simulations.

@Autoparallel Autoparallel reopened this Aug 18, 2023
@Autoparallel
Copy link
Collaborator

I see it was linked to #378 but I don't think we got this handled properly. It seems we should have created two issues:

  • Add ability to update blocks.
  • Add ability to update time.

@Autoparallel
Copy link
Collaborator

Closing to create a new issue.

@Autoparallel Autoparallel closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants