Skip to content

Commit

Permalink
[fastx client] Use new client functions, and remove old logic (Part 2) (
Browse files Browse the repository at this point in the history
#381)

* Added testing shorthands + test for get_all_owned_objects
* Added logic for processing order and certificate
* Use local structs for broadcast functions.
* Use new logic for sync with authorities
* Added test for sync_all_owned_objects
* Simplify test functions
* Delete old functions
* Remove requester and downloader

Co-authored-by: George Danezis <george@danez.is>
  • Loading branch information
gdanezis and George Danezis authored Feb 9, 2022
1 parent ee0f370 commit e669843
Show file tree
Hide file tree
Showing 7 changed files with 659 additions and 2,621 deletions.
6 changes: 2 additions & 4 deletions fastpay/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,7 @@ fn find_cached_owner_by_object_id(
.map(|acc| acc.address)
}

fn show_object_effects(order_info_resp: OrderInfoResponse) {
let order_effects = order_info_resp.signed_effects.unwrap().effects;

fn show_object_effects(order_effects: OrderEffects) {
if order_effects.status != ExecutionStatus::Success {
error!("Error publishing module: {:#?}", order_effects.status);
}
Expand Down Expand Up @@ -698,7 +696,7 @@ fn main() {
recv_timeout,
)
.await;
recipient_client_state.receive_object(&cert).await.unwrap();
recipient_client_state.sync_client_state().await.unwrap();
accounts_config.update_from_state(&recipient_client_state);
accounts_config
.write(accounts_config_path)
Expand Down
Loading

1 comment on commit e669843

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Bench results

�[0m�[0m�[1m�[32m Finished�[0m release [optimized + debuginfo] target(s) in 1.25s
�[0m�[0m�[1m�[32m Running�[0m target/release/bench
�[2m2022-02-09T11:24:55.441943Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Starting benchmark: OrdersAndCerts
�[2m2022-02-09T11:24:55.441987Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Preparing accounts.
�[2m2022-02-09T11:24:55.443280Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Open database on path: "/tmp/DB_D971B558D843020315AC20BC0A759208F086D0EB"
�[2m2022-02-09T11:25:00.443055Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Preparing transactions.
�[2m2022-02-09T11:25:09.030018Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m Listening to TCP traffic on 127.0.0.1:9555
�[2m2022-02-09T11:25:10.031411Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Number of TCP connections: 2
�[2m2022-02-09T11:25:10.031436Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Set max_in_flight to 500
�[2m2022-02-09T11:25:10.031440Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Sending requests.
�[2m2022-02-09T11:25:10.037850Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m Sending TCP requests to 127.0.0.1:9555
�[2m2022-02-09T11:25:10.056385Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m Sending TCP requests to 127.0.0.1:9555
�[2m2022-02-09T11:25:11.235400Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 5000 packets
�[2m2022-02-09T11:25:12.298868Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 35000
�[2m2022-02-09T11:25:12.462540Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 35000
�[2m2022-02-09T11:25:12.525081Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 10000 packets
�[2m2022-02-09T11:25:13.715787Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 15000 packets
�[2m2022-02-09T11:25:14.698536Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 30000
�[2m2022-02-09T11:25:14.913629Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 20000 packets
�[2m2022-02-09T11:25:14.920900Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 30000
�[2m2022-02-09T11:25:16.102072Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 25000 packets
�[2m2022-02-09T11:25:16.770080Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 25000
�[2m2022-02-09T11:25:16.823195Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 25000
�[2m2022-02-09T11:25:16.890291Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 30000 packets
�[2m2022-02-09T11:25:17.679218Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 35000 packets
�[2m2022-02-09T11:25:18.371119Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 20000
�[2m2022-02-09T11:25:18.425685Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 20000
�[2m2022-02-09T11:25:18.471349Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 40000 packets
�[2m2022-02-09T11:25:19.260840Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 45000 packets
�[2m2022-02-09T11:25:19.998430Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 15000
�[2m2022-02-09T11:25:20.001500Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 15000
�[2m2022-02-09T11:25:20.056111Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 50000 packets
�[2m2022-02-09T11:25:20.864514Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 55000 packets
�[2m2022-02-09T11:25:21.563033Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 10000
�[2m2022-02-09T11:25:21.591284Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 10000
�[2m2022-02-09T11:25:21.657155Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 60000 packets
�[2m2022-02-09T11:25:22.457755Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 65000 packets
�[2m2022-02-09T11:25:23.166636Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 5000
�[2m2022-02-09T11:25:23.211359Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m In flight 500 Remaining 5000
�[2m2022-02-09T11:25:23.249161Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 70000 packets
�[2m2022-02-09T11:25:24.040179Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 75000 packets
�[2m2022-02-09T11:25:24.847432Z�[0m �[32m INFO�[0m �[2mfastpay_core::authority_server�[0m�[2m:�[0m 127.0.0.1:9555 has processed 80000 packets
�[2m2022-02-09T11:25:24.866001Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m Done sending TCP requests to 127.0.0.1:9555
�[2m2022-02-09T11:25:24.888816Z�[0m �[32m INFO�[0m �[2mfastx_network::network�[0m�[2m:�[0m Done sending TCP requests to 127.0.0.1:9555
�[2m2022-02-09T11:25:24.889649Z�[0m �[32m INFO�[0m �[2mbench�[0m�[2m:�[0m Received 80000 responses.
�[2m2022-02-09T11:25:25.045872Z�[0m �[33m WARN�[0m �[2mbench�[0m�[2m:�[0m Completed benchmark for OrdersAndCerts
Total time: 14858195us, items: 40000, tx/sec: 2692.117043826656

Please sign in to comment.