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

fix: set robust limits for a busy blockchain #3150

Merged

Conversation

hansieodendaal
Copy link
Contributor

@hansieodendaal hansieodendaal commented Jul 30, 2021

Description

Updated limits for the base node and wallet that would be robust for a busy blockchain - this was simulated with two sizeable stress tests of 15,000 transactions each, using 3 sender wallets to 3 receiver wallets, with 5,000 to between each wallet pair. Both tests returned a 100% mined as confirmed success ratio. These tests also utilized the new persistent dedup message cache.

The following previous stress test issues were addressed with this PR:

  • Mempool view was considerably different between base nodes.
  • Communications were breaking down on some base nodes with this huge amount of messages.
  • Lots of message flood banning were taking place.
  • Excessive numbers of SAF messages were being sent for the same transaction.
  • Base node not responding after sync request failed.
  • Console wallet broadcast status was not being updated correctly with many (thousands) transactions present.

The wallet edit:transaction event broadcast channel was made configurable due to an increase from 200 to 5,500 not being enough as shown by the results below. (The mobile wallet can use the default or its own config settings for memory preservation.)

Event Received Missed
ReceivedTransaction 943 4060
ReceivedFinalizedTransaction 1958 3045
TransactionBroadcast 1961 3042
TransactionMinedUnconfirmed 2013 2990
TransactionMined 2059 2944
Totals Value
Transactions mined 5003
Events missed 16081
Lagging reads 800
Events not fired 15281

Motivation and Context

See above

How Has This Been Tested?

System-level stress tests

Checklist:

  • I'm merging against the development branch.
  • I have squashed my commits into a single commit.

@hansieodendaal hansieodendaal changed the title Set robust limits for busy a blockchain fix: set robust limits for busy a blockchain Jul 30, 2021
@hansieodendaal hansieodendaal changed the title fix: set robust limits for busy a blockchain fix: set robust limits for a busy blockchain Jul 30, 2021
@@ -106,7 +106,7 @@ where T: OutputManagerBackend + 'static
);

let (sender, receiver) = reply_channel::unbounded();
let (publisher, _) = broadcast::channel(200);
let (publisher, _) = broadcast::channel(3500);
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this use the new config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was actually only the transaction event channel size that was made configurable due to stats in the description; do you suggest having more of these configurable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ja, if we are doing it then I think we should do it for both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool, making all those broadcast channels sizes configurable in the config file.

@hansieodendaal hansieodendaal force-pushed the ho_set_robust_limits branch 2 times, most recently from c0faa33 to a6f6a8f Compare August 3, 2021 13:02
Copy link
Contributor

@philipr-za philipr-za left a comment

Choose a reason for hiding this comment

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

I don't think the channel sizes should be in the config file, it really feels like we are bloating the config file with stuff that 99.99% of end users will not care about and the config file is getting insanely bloated.

I say put them in the config object with default values and then its possible to set them via environment variables if we need to.

output_manager_event_channel_size = 3500
# This is the size of the event channel used to communicate base node update events to the wallet. A busy console
# wallet doing thousands of bulk payments or used for stress testing needs a fairly big size (>300) (default = 50).
base_node_update_publisher_channel_size = 500
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for the sake of not bloating this file further. I really think this one can come out as it is not a function of how many transaction's there are its a function of how many times a client makes the call.

stringhandler
stringhandler previously approved these changes Aug 4, 2021
Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

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

Seems like a little too much config. E.g. I wouldn't even know a good value for a channel size, who exactly would want to tweak this?

That said, I like the other parts of the PR and those fields can be removed from config later if we need to.

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 4, 2021

PR queued successfully. Your position in queue is: 3

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 4, 2021

PR is on top of the queue now

@aviator-app aviator-app bot added the mq-failed label Aug 4, 2021
@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 4, 2021

PR failed to merge with reason: Some CI status(es) failed
Failed CI(s): ci/circleci: run-integration-tests

stringhandler
stringhandler previously approved these changes Aug 7, 2021
@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 7, 2021

PR queued successfully. Your position in queue is: 3

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 7, 2021

PR is on top of the queue now

@aviator-app aviator-app bot added the mq-failed label Aug 7, 2021
@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 7, 2021

PR failed to merge with reason: Some CI status(es) failed
Failed CI(s): ci/circleci: run-integration-tests

@hansieodendaal hansieodendaal force-pushed the ho_set_robust_limits branch 2 times, most recently from 47e74f5 to 0a01a3b Compare August 8, 2021 06:31
stringhandler
stringhandler previously approved these changes Aug 9, 2021
@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 9, 2021

PR queued successfully. Your position in queue is: 1

@aviator-app aviator-app bot added the mq-failed label Aug 9, 2021
@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 9, 2021

PR failed to merge with reason: Some CI status(es) failed
Failed CI(s): ci/circleci: run-integration-tests

@aviator-app aviator-app bot removed the mq-failed label Aug 10, 2021
@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 10, 2021

PR queued successfully. Your position in queue is: 1

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 10, 2021

PR failed to merge with reason: Some CI status(es) failed
Failed CI(s): ci/circleci: run-integration-tests

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 10, 2021

Waiting for approval before queuing

Updated limits for the base node and wallet that would be robust for
a busy blockchain - this was simulated with two sizeable stress tests
of 15,000 transactions each.
@stringhandler stringhandler merged commit c993780 into tari-project:development Aug 12, 2021
@hansieodendaal hansieodendaal deleted the ho_set_robust_limits branch August 12, 2021 06:52
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