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

Minor simulator fixes #703

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/simulator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To start a single node network, follow the instructions from the AvalancheGo [RE
Once you've built AvalancheGo, open the AvalancheGo directory in a separate terminal window and run a single node non-staking network with the following command:

```bash
./build/avalanchego --staking-enabled=false --network-id=local
./build/avalanchego --sybil-protection-enabled=false --network-id=local
```
Copy link
Contributor

Choose a reason for hiding this comment

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

curious what does this do

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's the same option, just renamed. disabling staking/sybil protection allows the local network to have validators without staking tokens.

Copy link
Contributor

Choose a reason for hiding this comment

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

nice thanks


WARNING:
Expand Down
2 changes: 1 addition & 1 deletion cmd/simulator/load/funder.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func DistributeFunds(ctx context.Context, client ethclient.Client, keys []*key.K
if err != nil {
return nil, fmt.Errorf("failed to fetch balance for addr %s: %w", addr, err)
}
log.Info("Funded address has balance", "balance", balance)
log.Info("Funded address has balance", "addr", addr, "balance", balance)
}
fundedKeys = append(fundedKeys, needFundsKeys...)
return fundedKeys, nil
Expand Down
10 changes: 5 additions & 5 deletions cmd/simulator/txs/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ func (a issueNAgent[T]) Execute(ctx context.Context) error {

for {
var (
txs = make([]T, 0, a.n)
tx T
done bool
txs = make([]T, 0, a.n)
tx T
ok bool
)
for i := uint64(0); i < a.n; i++ {
select {
case tx, done = <-txChan:
if done {
case tx, ok = <-txChan:
if !ok {
return a.worker.Close(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

AWESOME catch!

}
case <-ctx.Done():
Expand Down