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

Rust simulator L1 scaffolding #36

Merged
merged 8 commits into from
Oct 7, 2024
Merged

Rust simulator L1 scaffolding #36

merged 8 commits into from
Oct 7, 2024

Conversation

SupernaviX
Copy link
Contributor

@SupernaviX SupernaviX commented Oct 3, 2024

Scaffolding for (a command-line version of) the L1 chain for the rust Leios simulator. This is very WIP (I'm still trying to understand a lot about the problem, including what input/output should even look like), but I'm opening a PR in the interest of transparency.

This isn't a long-lived branch, I expect to merge (or discard) these changes after a week or two.

Fixes #34

So far, this has a fake-VRF lottery for block production, and logs stats about how many blocks were published and by which pools.


impl Simulation {
pub fn new(config: SimConfiguration) -> Self {
let mut rng = ChaChaRng::from_rng(thread_rng()).expect("couldn't initialize RNG");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably want the seed as part of the SimConfiguration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Quantumplation I don't want to make guarantees of determinism unless it's necessary. The ce_netsim library forces everything to be "realtime", and I'm worried that determinism will be hard to maintain if actual threads are interacting.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even outside of making it deterministic, just generating things like the same slot schedule, connections, topology, etc. over multiple runs is super useful.

@abailly-iohk
Copy link
Contributor

This isn't a long-lived branch, I expect to merge (or discard) these changes after a week or two.
😂 To me a short-lived branch is one that is not older than 2 days

@SupernaviX SupernaviX merged commit 4616dc1 into main Oct 7, 2024
4 checks passed
@SupernaviX SupernaviX deleted the sim-rs-setup branch October 7, 2024 22:01
@SupernaviX
Copy link
Contributor Author

This isn't a long-lived branch, I expect to merge (or discard) these changes after a week or two.
😂 To me a short-lived branch is one that is not older than 2 days

I merged it, but developing against main on a shared repo feels icky

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 this pull request may close these issues.

Rust simulation of L1 chain
3 participants