zold-io / zold

An Experimental Non-Blockchain Cryptocurrency for Fast Micro Payments
https://www.zold.io
MIT License
195 stars 53 forks source link

wallet.rb is too slow #484

Closed yegor256 closed 5 years ago

yegor256 commented 5 years ago

It reads the file and parses it multiple times.

yegor256 commented 5 years ago

@rultor release, tag is 0.14.43

rultor commented 5 years ago

@rultor release, tag is 0.14.43

@yegor256 OK, I will release it now. Please check the progress here

rultor commented 5 years ago

@rultor release, tag is 0.14.43

@yegor256 Oops, I failed. You can see the full log here (spent 9min)

Score counting started in process #27923
The list of remotes is \u001b[31mempty\u001b[0m, run 'zold remote reset'!
The list of remotes is \u001b[31mempty\u001b[0m, run 'zold remote reset'!
Reconnected, there are 0 remote notes: 
Routine Zold::Routines::Reconnect #0 done in 0.01s
127.0.0.1 - - [10/Oct/2018:17:22:19 +0000] "GET / HTTP/1.1" 200 - 0.0029
Push scheduled for 7fc7f266a4f2e11d, queue size is 1
Waiting for spread entrance to finish...
Spread entrance finished, thread killed
going to shutdown ...
WEBrick::HTTPServer#start done.
The web front stopped at http://localhost:35739
Thanks for helping Zold network!
Stopping the metronome with 2 threads: Zold::Routines::Spread, Zold::Routines::Reconnect
\u001b[31mlocalhost:35739\u001b[0m: Failed to open TCP connection to localhost:35739 (Cannot assign requested address - connect(2) for "localhost" port 35739) (HTTP code 599, instead of 200) in 0s
RuntimeError: Failed to open TCP connection to localhost:35739 (Cannot assign requested address - connect(2) for "localhost" port 35739) (HTTP code 599, instead of 200)
    /home/r/repo/lib/zold/remotes.rb:98:in `assert_code'
    /home/r/repo/lib/zold/commands/push.rb:102:in `block in push_one'
    /home/r/repo/lib/zold/sync_wallets.rb:73:in `block (2 levels) in find'
    /home/r/repo/lib/zold/sync_wallets.rb:55:in `open'
    /home/r/repo/lib/zold/sync_wallets.rb:55:in `block in find'
    /home/r/repo/lib/zold/wallets.rb:66:in `find'
    /home/r/repo/lib/zold/sync_wallets.rb:52:in `find'
    /home/r/repo/lib/zold/commands/push.rb:96:in `push_one'
    /home/r/repo/lib/zold/commands/push.rb:75:in `block in push'
    /home/r/repo/lib/zold/remotes.rb:188:in `block (2 levels) in iterate'
New score discovered: 1/2: 2018-10-10T17:22:18Z localhost 35739 NOPREFIX@ffffffffffffffff 120
No need to kill process #27923 since it's dead already: No such process
Score counting started in process #27937
Thread Zold::Routines::Spread finished in 0.53s
Thread Zold::Routines::Reconnect finished in 0.0s
Metronome stopped in 0.53s, 0 failures
Terminating the farm with 1 threads...
Attempting to terminate the thread "cleanup"...
New score discovered: 2/2: 2018-10-10T17:22:18Z localhost 35739 NOPREFIX@ffffffffffffffff 120 14c
No need to kill process #27937 since it's dead already: No such process
It's time to stop the cleanup thread (9 != 600, alive=false)...
Thread "cleanup" finished in 0.0s
Attempting to terminate the thread "1:1722"...
Thread "1:1722" finished in 0.0s
Farm stopped in 0.03s
Stopping async entrance, pool length is 96, queue length is 0
Async entrance terminated peacefully
Waiting for spread entrance to finish...
Spread entrance finished, thread killed
\u001b[32m.\u001b[0m\u001b[32m.\u001b[0mWaiting for spread entrance to finish...
Spread entrance finished, thread killed
\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[33mS\u001b[0m\u001b[33mS\u001b[0m\u001b[32m.\u001b[0m\u001b[33mS\u001b[0m\u001b[33mS\u001b[0m

Finished in 297.869420s, 0.8326 runs/s, 13.7711 assertions/s.
248 runs, 4102 assertions, 1 failures, 0 errors, 7 skips

You have skipped tests. Run with --verbose for details.
rake aborted!
Command failed with status (1)
/home/r/.ruby/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => default => test
(See full trace by running task with --trace)
container c30369507a62d689bb80777c3611a7e016d77d26572511a8b8905ed53447f926 is dead
Wed Oct 10 19:22:58 CEST 2018
yegor256 commented 5 years ago

@rultor release, tag is 0.14.43

rultor commented 5 years ago

@rultor release, tag is 0.14.43

@yegor256 OK, I will release it now. Please check the progress here

rultor commented 5 years ago

@rultor release, tag is 0.14.43

@yegor256 Oops, I failed. You can see the full log here (spent 11min)

Local copy of 36042eaedded8fba merged: nothing
1 copies with the total score of 10 successfully merged into 36042eaedded8fba/\u001b[31m-14.95ZLD\u001b[0m/1t
Wallet 36042eaedded8fba propagated successfully, 0 wallets affected
\u001b[32m.\u001b[0mBuilding a patch for 5dda391daaee65eb from remote copy localhost...
The baseline of 0 transactions ignored
\u001b[31mERROR\u001b[0m: Transaction #1 attempts to make the balance of 5dda391daaee65eb/0.00/0 negative: #1 2018-10-10T17:59:13Z \u001b[31m-9.99ZLD\u001b[0m c18b962d77788c46 -
Copy localhost of 5dda391daaee65eb merged: nothing
Local copy of 5dda391daaee65eb merged: nothing
0 copies with the total score of 0 successfully merged into 5dda391daaee65eb/\u001b[31m-9.99ZLD\u001b[0m/1t
Wallet 5dda391daaee65eb propagated successfully, 0 wallets affected
\u001b[32m.\u001b[0m\u001b[32m.\u001b[0mBuilding a patch for 0000000000000000 from remote copy 1/0/5...
The baseline of 0000000000000000 is \u001b[32m0.00ZLD\u001b[0m/0t
Copy 1/0/5 of 0000000000000000 merged: nothing
Building a patch for 0000000000000000 from remote copy localhost...
Merged on top, balance is \u001b[31m-9.99ZLD\u001b[0m: #1 2018-10-10T17:59:13Z \u001b[31m-9.99ZLD\u001b[0m 73f23b2cf379776f -
Copy localhost of 0000000000000000 merged: 1 txns
Local copy of 0000000000000000 merged: 1 txns
Nothing changed in 0000000000000000 after merge of 1 copies
\u001b[32m.\u001b[0m0 expired local copies removed for 4af4a28715b26aa5, 0 left:
localhost:80/0 returned 762b/\u001b[32m0.00ZLD\u001b[0m/0t/00762c/0.5s/c as copy 1 of 4af4a28715b26aa5 in 0.0s: \u001b[32m0\u001b[0m (0.14.43)
1 copies of 4af4a28715b26aa5 fetched in 0s with the total score of 0 from 1 nodes
1 local copies:
  1: 0 \u001b[32m0.00ZLD\u001b[0m/0t/00762c/762b/0.01s
Building a patch for 4af4a28715b26aa5 from remote copy 1/0/0...
The baseline of 4af4a28715b26aa5 is \u001b[32m0.00ZLD\u001b[0m/0t
Copy 1/0/0 of 4af4a28715b26aa5 merged: nothing
Building a patch for 4af4a28715b26aa5 from remote copy localhost...
Copy localhost of 4af4a28715b26aa5 merged: nothing
Local copy of 4af4a28715b26aa5 merged: nothing
Nothing changed in 4af4a28715b26aa5 after merge of 1 copies
\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[31mlocalhost:81\u001b[0m: Wallet 8017b4e7e70be9ca not found in 0s
RuntimeError: Wallet 8017b4e7e70be9ca not found
    /home/r/repo/lib/zold/commands/fetch.rb:109:in `fetch_one'
    /home/r/repo/lib/zold/commands/fetch.rb:86:in `block in fetch'
    /home/r/repo/lib/zold/remotes.rb:188:in `block (2 levels) in iterate'
localhost:80/0 returned 762b/\u001b[32m0.00ZLD\u001b[0m/0t/?/0.53s/c as copy 1 of 8017b4e7e70be9ca in 0.0s: \u001b[32m0\u001b[0m ()
1 copies of 8017b4e7e70be9ca fetched in 0s with the total score of 0 from 2 nodes
1 local copies:
  1: 0 \u001b[32m0.00ZLD\u001b[0m/0t/ca721f/762b/0.01s
\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m14.95ZLD\u001b[0m sent from 800c7948a7ae2ba5 to bd2d2295a3ee0ca5: -
Don't forget to do 'zold push 800c7948a7ae2ba5'
1
The tax debt of 800c7948a7ae2ba5 is \u001b[32m0.00ZLD\u001b[0m (still acceptable)
\u001b[32m14.95ZLD\u001b[0m to bd2d2295a3ee0ca5: wallet is absent
Wallet 800c7948a7ae2ba5 propagated successfully, 0 wallets affected
The baseline of 800c7948a7ae2ba5 is \u001b[32m0.00ZLD\u001b[0m/0t
\u001b[31m-0001;2018-10-10T17:59:13Z;fffffff10ccccccd;NOPREFIX;bd2d2295a3ee0ca5;-;hheke5wDqv24w2yjh8koFWeKvDryFJRaTtY6O7WyjJUmeH1lNWhN6nmP/sZKFeMI6yrM7GcbuI47vt0tVvbNhRrohJl9HsqR/rKEeEhYPE3b+gfz09KJzI2die+TgzkALoPYNbIWgcKqMKBLzP+J4qkqKuFchCGAlUsFYz+RTh49U7kUd4eeT7kXE+gPUH+xD1TNk6kY+Ex84tCmatj859CKqn8x9OR3cB3MU9/GJLHAkJUim/9iWmn5v26HKgf/2cyglvSWZVZd8fArDLwfNMVVXICiC9eWIIlipymKCcGSRkragqK1H7UIUoFpWCx6Bg/5lrJq0QmER20t4laGPpaexYowLIkRbEPyfBlLNB/cygXA+rBebYOV/W+247olFlJPnoG8/CAc2Nh79vgt/RqfXNEWpD4CwuUO38Ppp2a+f8gi62/A/4eCrGNw3MUX3hIBAk5K2Pui4WYPoDOXdluIvXPV7cBLF6rmWuGvdD9bLUyk833TxupLhznq51qQHBKy4bZvsrDTdCvn2ENeCXXYCqJ2CZYRLB+N3T3pk/Q1YxKwzLG+4PZngRC9nylwDKN6vQYhduZ5xd8sfvxBlSy3/+ddJ+tu/GSjTr56EFldEMKSs+KXKHsRDpPYMGxIZmVRs9xtPloSjU5EsrFS7928DC0nMp43jLtxjFPgBls=\u001b[0m
\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m

Finished in 308.702141s, 0.8034 runs/s, 13.2847 assertions/s.
248 runs, 4101 assertions, 1 failures, 0 errors, 7 skips

You have skipped tests. Run with --verbose for details.
rake aborted!
Command failed with status (1)
/home/r/.ruby/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => default => test
(See full trace by running task with --trace)
container 94ddcd8a6d20b2c74c7a262eb9721311b8cd29bf474f7aa81e60088f0ff0663e is dead
Wed Oct 10 20:01:32 CEST 2018
yegor256 commented 5 years ago

@rultor release, tag is 0.14.43

rultor commented 5 years ago

@rultor release, tag is 0.14.43

@yegor256 OK, I will release it now. Please check the progress here

rultor commented 5 years ago

@rultor release, tag is 0.14.43

@yegor256 Oops, I failed. You can see the full log here (spent 8min)

Installing sys-proctable 1.1.5 (universal-linux)
Fetching usagewatch 0.0.7
Installing usagewatch 0.0.7
Fetching usagewatch_ext 0.2.0
Installing usagewatch_ext 0.2.0
Fetching webmock 3.4.2
Installing webmock 3.4.2
Fetching xcop 0.6
Installing xcop 0.6
Using zold 0.14.43 from source at `.`
Bundle complete! 7 Gemfile dependencies, 90 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Post-install message from usagewatch:
* Linux version are covered for our test.
Thanks for installing!
Post-install message from usagewatch_ext:
* Usagewatch Gem for linux are covered for our test.
* Mac OS version is in development
Thanks for installing!
+ rake --quiet
Coverage report generated for Unit Tests to /home/r/repo/coverage. 965 / 2906 LOC (33.21%) covered.
Run options: --seed 11229

# Running:

\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[33mS\u001b[0m\u001b[33mS\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[33mS\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[31mF\u001b[0m

\u001b[31mFailure:
TestEntrance#test_renders_json [/home/r/repo/test/node/test_entrance.rb:70]:
Expected false to be truthy.
\u001b[0m

bin/rails test home/r/repo/test/node/test_entrance.rb:64

\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m#<Thread:0x0000000001cd5c98@/home/r/repo/test/node/fake_node.rb:45 run> terminated with exception (report_on_exception is true):
\u001b[1mTraceback\u001b[m (most recent call last):
    3: from /home/r/repo/test/node/fake_node.rb:46:in `block (3 levels) in run'
    2: from /home/r/repo/lib/zold/verbose_thread.rb:38:in `run'
    1: from /home/r/repo/test/node/fake_node.rb:49:in `block (4 levels) in run'
/home/r/repo/lib/zold/commands/node.rb:201:in `run': \u001b[1mAlias should be a 4 to 16 char long alphanumeric string: invalid-alias (\u001b[1;4mRuntimeError\u001b[m\u001b[1m)
\u001b[m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[33mS\u001b[0m\u001b[33mS\u001b[0m\u001b[32m.\u001b[0m\u001b[33mS\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[33mS\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m

Finished in 238.266869s, 1.0408 runs/s, 17.2160 assertions/s.
248 runs, 4102 assertions, 1 failures, 0 errors, 7 skips

You have skipped tests. Run with --verbose for details.
rake aborted!
Command failed with status (1)
/home/r/.ruby/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => default => test
(See full trace by running task with --trace)
container c029d2583647082d059b79dfa7b7352fef2ef9e6afb0f870fd443136e563f251 is dead
Wed Oct 10 20:17:41 CEST 2018
yegor256 commented 5 years ago

@rultor release, tag is 0.14.43

rultor commented 5 years ago

@rultor release, tag is 0.14.43

@yegor256 OK, I will release it now. Please check the progress here

rultor commented 5 years ago

@rultor release, tag is 0.14.43

@yegor256 Done! FYI, the full log is here (took me 8min)

0crat commented 5 years ago

Job gh:zold-io/zold#484 is not assigned, can't get performer

0crat commented 5 years ago

This job is not in scope