Skip to content

Conversation

@masih
Copy link
Member

@masih masih commented Apr 26, 2024

Refactor the simulation initialization to accept a variable number of Option arguments. These options transform constants into adjustable parameters, such as the latency model, enabling a versatile combination of simulation scenarios.

Update the test suite to reflect these changes, eliminating redundant code. Convert dedicated tests into table tests, which now include basic tests covering BLS, non-BLS, agreement, and split convergence onto the base chain.

Refactor no-latency, also known as sync tests, to explicitly utilize a latency.None model, enhancing clarity.

Restructure adversary instantiation within a Generator. This change streamlines the adversary API, allowing it to leverage the existing gpbft API for initiating adversary logic, and obviates the need for specific Begin functions previously invoked sporadically across tests. Additionally, introducing generators enables the simulation API to present a fixed set of receivers and privatize most fields and receiver functions, minimizing potential errors when utilizing simulation APIs.

The current revisions include several TODO markers for future enhancements to maintain a manageable scope of changes in this pull request. The refactoring facilitates the future addition of probabilistic adversary populations and probabilistic ec chain mutations, with implementation details to follow in subsequent PRs.

Refactor the simulation initialization to accept a variable number of
Option arguments. These options transform constants into adjustable
parameters, such as the latency model, enabling a versatile combination
of simulation scenarios.

Update the test suite to reflect these changes, eliminating redundant
code. Convert dedicated tests into table tests, which now include basic
tests covering BLS, non-BLS, agreement, and split convergence onto the
base chain.

Refactor no-latency, also known as sync tests, to explicitly utilize a
latency.None model, enhancing clarity.

Restructure adversary instantiation within a Generator. This change
streamlines the adversary API, allowing it to leverage the existing
gpbft API for initiating adversary logic, and obviates the need for
specific Begin functions previously invoked sporadically across tests.
Additionally, introducing generators enables the simulation API to
present a fixed set of receivers and privatize most fields and receiver
functions, minimizing potential errors when utilizing simulation APIs.

The current revisions include several TODO markers for future
enhancements to maintain a manageable scope of changes in this pull
request. The refactoring facilitates the future addition of
probabilistic adversary populations and probabilistic ec chain
mutations, with implementation details to follow in subsequent PRs.
@masih masih requested a review from Kubuxu April 26, 2024 18:49
@masih masih enabled auto-merge April 26, 2024 18:50
@masih masih changed the title Introduce additional simulation options and restructure constants. Introduce additional simulation options and restructure constants Apr 29, 2024
opts.graniteConfig = &defaultGraniteConfig
}
if opts.signingBacked == nil {
opts.signingBacked = signing.NewFakeBackend()
Copy link
Contributor

Choose a reason for hiding this comment

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

BLS envvar override is missing

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to f3sim command as it is the entrypoint to running a simulation.

Does that make sense?

Copy link
Contributor

@Kubuxu Kubuxu Apr 29, 2024

Choose a reason for hiding this comment

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

When working on BLS, I used it to run all the tests with BLS as a final sanity check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Noted. I'll make sure that env var is respected in test scope.

Copy link
Contributor

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

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

Apart from the one comment, SGWM.

@masih masih added this pull request to the merge queue Apr 29, 2024
Merged via the queue into main with commit 7eaa6d1 Apr 29, 2024
@masih masih deleted the masih/refactor-sim-options branch April 29, 2024 12:41
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.

3 participants