adshares/ads

balance in get_block is different than sum from get_accounts

Closed this issue · 1 comments

11:21:41.952 [main] INFO  c.runtime.formatter.Slf4jFormatter -     Given user, who will check get_accounts function # FunctionStepDefs.user_who_check_log_account(String)
11:21:41.952 [main] DEBUG n.a.ads.qa.util.FunctionCaller - getAccounts node=9, block=0
11:21:41.952 [main] DEBUG n.a.ads.qa.util.FunctionCaller - request: echo '{"run":"get_accounts", "node":9, "block":"0"}' | docker exec -i adshares_ads_1 ads -n0 -w /ads-data/tmp -P9006 -Hesc.dock -A0006-00000000-FCBB -sE61EF033B18C346A53FCCC589DF317D11810A40549DEDEF3F6B8B66003BEB84C
11:21:42.057 [main] DEBUG n.a.ads.qa.util.FunctionCaller - resp: {"current_block_time":"1530782496","previous_block_time":"1530782464","tx":{"data":"1806000000000026E33D5B000000000900BDCC0CDF44E1A0A2699D2FD38D9BF5028B52C59B1A3E547D288C8BC5DC4AF93EC796696E946281981BC1A8C058195FEDBAEA2456D5E101A338A62C1F6CEDEE00","account_msid":"0","account_hashin":"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","account_hashout":"6CAB7749F7179383C8A129BA02C7831E0C56A1AEA47A866C2B52982F438EE6E2","deduct":"0.00000000000","fee":"0.00000000000"},"accounts":[{"address":"0009-00000000-9942","node":"9","id":"0","msid":"1","time":"1530782432","date":"2018-07-05 11:20:32","status":"0","paired_node":"9","paired_id":"0","local_change":"1530782432","remote_change":"1530782432","balance":"1788840.27692306690","public_key":"EFE862FA47E4BF2FA8A7F93F86734382998E7129594BC9A1E9C813A95099DD3E","hash":"57875A2AECB32B72DAA4A4709A083E8AD508C76C5FC53165ABB7F4913CB585A7"}]}

    When user calls get_accounts function            # FunctionStepDefs.user_calls_get_accounts_function()
11:21:42.058 [main] INFO  c.runtime.formatter.Slf4jFormatter -     When user calls get_accounts function            # FunctionStepDefs.user_calls_get_accounts_function()
11:21:42.059 [main] DEBUG n.a.ads.qa.util.FunctionCaller - getBlock
11:21:42.059 [main] DEBUG n.a.ads.qa.util.FunctionCaller - request: echo '{"run":"get_block"}' | docker exec -i adshares_ads_1 ads -n0 -w /ads-data/tmp -P9006 -Hesc.dock -A0006-00000000-FCBB -sE61EF033B18C346A53FCCC589DF317D11810A40549DEDEF3F6B8B66003BEB84C
11:21:42.221 [main] DEBUG n.a.ads.qa.util.FunctionCaller - resp: {"current_block_time":"1530782496","previous_block_time":"1530782464","tx":{"data":"1706000000000000E33D5B26E33D5BB1055B45B4879ACEC330A0D9D8FF154549492D3B611E8CB091972A3FB4544B8ABA5CAD1A66D215365B47648632D5541FD3306B248FB3B23F9E7E114AFAD93406"},"block_time_hex":"5B3DE300","block_time":"1530782464","block_prev":"5B3DE2E0","block_next":"5B3DE320","block":{"id":"5B3DE300","time":"1530782464","message_count":"20","oldhash":"938657717A6FDD415AF406164696960EB000EE2DAAE2763B542ED3FF11FAEC5D","minhash":"A1ADF97A70A191C6F8E397F68AEB50996E8986D133ED82F5B32FEEC50FDEC8B1","msghash":"177424AAA50FABF03200BB7374D5DCC85BE4F3412E3758BFC4D313BD224DD012","nodhash":"E03936A1212F3DBEE153BD95376E244E145ADC9D24D90C0819FA501482A215D8","viphash":"23A7002738367EC99A7BD2988720FF0824580219D2502226084E1BCE11A0B634","nowhash":"FECD0ED51813152FD7846BF7B09DD5C984422699B04DCDC9DE8F5A6ADD8E05B9","vote_yes":"0","vote_no":"0","vote_total":"7","node_count":"11","dividend_balance":"0.00000000000","dividend_pay":"true","nodes":[{"id":"0000","public_key":"0000000000000000000000000000000000000000000000000000000000000000","hash":"0000000000000000000000000000000000000000000000000000000000000000","message_hash":"3C88D014107EDA14F7E11C2532760ED0AC03C9B6C85BC4EACE05E72359781076","msid":"0","mtim":"1530782432","balance":"0.00000000000","status":"0","account_count":"0","port":"0","ipv4":"0.0.0.0"},{"id":"0001","public_key":"73A5C92FA5142599B1C9863B43E026AFEFA6B57AEE8D189241C7F50C90BA5122","hash":"B9AD229A6136FC4CB8A77B620A3926C19FA121A5C2F1A05811C459BEE166117C","message_hash":"2D889AB3242FCA426A7EE948C23E7D86D7D5262D0B08F540E3156C34C6D45473","msid":"1","mtim":"1530782468","balance":"6559081.01522455342","status":"6","account_count":"1","port":"8001","ipv4":"172.16.222.101"},{"id":"0002","public_key":"FC4CA38301AC2080ADA2BC08C4A94405E546B659BD2EB559C1520A55586336CD","hash":"FC5C1309B161EC9A639E5928E4D75341C98FDC38F79949BB335A77E8905786C9","message_hash":"F0115800909100462A4E42AE0D98BBC79991E2D382C5F15EE83B67F76776E31A","msid":"2","mtim":"1530782478","balance":"5962800.92291681912","status":"2","account_count":"1","port":"8002","ipv4":"172.16.222.101"},{"id":"0003","public_key":"5138AA57FAF5F7F2E67BDCA14F3CC377CD4C681B3F8B5A41DDDD590BD36C3125","hash":"B115ED3B4CC46C8BBEAC4AF401009005E57C02DDB5596AEF0DA484EC6A6CCD60","message_hash":"D4291CCBC6E5A2E61EB101825F11B0BAA6705125F9BC0868EE1E7517A9AC7831","msid":"1","mtim":"1530782468","balance":"5366520.83060916881","status":"2","account_count":"1","port":"8003","ipv4":"172.16.222.101"},{"id":"0004","public_key":"BB6D774EA23DFB4D6510F04EFFA79FCA281C046CB39143B101CB451D0919AFA9","hash":"2C9A34ACB10CAD4D8D489A934EBCF82334962E3AF2DC0D4586A2E14315605EEC","message_hash":"15B3F6620AB9C809F033FFC1CC6E1C0B1433315212C6E176084C43E3E95B87CA","msid":"2","mtim":"1530782486","balance":"4770240.73830143463","status":"2","account_count":"1","port":"8004","ipv4":"172.16.222.101"},{"id":"0005","public_key":"BCEEFF93B281A5FB95B3F05922DC3D9B4BDE91FC8116C340068F778CA16F2564","hash":"851C35D7F501F735D1EB181ABD59EA4C3511E41CB5A38B3358E6CD208CF9DCBD","message_hash":"780EC989D81817D3806C09C90759E979D6F8ACCF5CF72511480D5084D27AF390","msid":"2","mtim":"1530782474","balance":"4173960.64599374211","status":"2","account_count":"1","port":"8005","ipv4":"172.16.222.101"},{"id":"0006","public_key":"3A1969E7A8F418537CBCBEDB8FDC8E4C5B4D78C4D73970B9E2739055FF4E883E","hash":"79549518C4C82ACC7CE04C29BA93291510DB1F637B2EEF2DCB61B54E324845F6","message_hash":"288ECF46F33422BEC572760640AA0F5CB54F4E75ADC7802AD2356877A783E9A3","msid":"4","mtim":"1530782488","balance":"3577680.55368596628","status":"2","account_count":"1","port":"8006","ipv4":"172.16.222.101"},{"id":"0007","public_key":"64938E054C70E26F37E56474B20E78691ACE89A441018041FDFFAC2B224BE55C","hash":"E9CE37D063B93008CF9B8E6074ED0A0728BB6247DC82EB184DAA9B11B2962F2A","message_hash":"83A979644E01961A9EA9D5D71C9B0C6C4CD149C1A1AF2BF206C80F65451C1EEB","msid":"1","mtim":"1530782468","balance":"2981400.46137839940","status":"2","account_count":"1","port":"8007","ipv4":"172.16.222.101"},{"id":"0008","public_key":"DE5C6E34A1E694E5B5FA497CD488685FFBED0CCA3A840094AB0631EBD250ADC0","hash":"0BDDC54D482E182259D18358F09389C20C0B3998EA5A78C56F024A86A043CF67","message_hash":"62001B67B2EDE7C8C04D9DA3682404566B7D258E3BEBBE733A3F3500F95284F1","msid":"2","mtim":"1530782486","balance":"2385120.36907066544","status":"0","account_count":"1","port":"8008","ipv4":"172.16.222.101"},{"id":"0009","public_key":"1C726BFC7B795B71B6FEBB084157DE14C60379C80EFC903CC8783C733C2AD3D4","hash":"C619262D4CED5F5F6AAC05E4B053B807BBD751B13E8FB2D4866CA3F8AEE8D4BD","message_hash":"4296773433C06653EB8CBAA8126E90A4BC0977675E16A933CAECFF0E034D9318","msid":"1","mtim":"1530782468","balance":"1788840.27676301502","status":"0","account_count":"1","port":"8009","ipv4":"172.16.222.101"},{"id":"000A","public_key":"3D22D7095007382ADD6F9530100F3F5FC42E82FE79FC69726B3F95E57C558C3F","hash":"E7A4FDA37D5CE9B100C8E522D67E08BA71E8CF15F65BB38408A9CEE7F9FEB28C","message_hash":"E1AD3AD3C45B67DDDE9289842AA819D6C078C4146038186CB0427654B0EC6E16","msid":"4","mtim":"1530782488","balance":"1192560.18445519708","status":"0","account_count":"1","port":"8010","ipv4":"172.16.222.101"}]}}

11:21:42.228 [main] DEBUG n.a.ads.qa.util.FunctionCaller - getBlock resp in 1 attempt
11:21:42.230 [main] DEBUG n.a.ads.qa.stepdefs.FunctionStepDefs - totalBalance: 1788840.27692306690
11:21:42.230 [main] DEBUG n.a.ads.qa.stepdefs.FunctionStepDefs - nodeBalance : 1788840.27676301502
11:21:42.230 [main] DEBUG n.a.ads.qa.stepdefs.FunctionStepDefs - diff        : 0.00016005188
11:21:42.232 [main] DEBUG n.a.ads.qa.util.FunctionCaller - getLog from 0
11:21:42.233 [main] DEBUG n.a.ads.qa.util.FunctionCaller - request: echo '{"run":"get_log", "from":"0"}' | docker exec -i adshares_ads_1 ads -n0 -w /ads-data/tmp -P9009 -Hesc.dock -A0009-00000000-9942 -sFADB58698B7A13405C485C3FD86BD2C2B9F476853E1AE2A7767C2869F06ABC1D
11:21:42.377 [main] DEBUG n.a.ads.qa.util.FunctionCaller - resp: {"current_block_time":"1530782496","previous_block_time":"1530782464","tx":{"data":"1109000000000000000000E508828A46A723FF18E59B68DE048662453B14FB3A7B246DAE7F4A3C54C4AC049659B0E4977E98B3E53DC8933EB6667BC6A5D320CB75BBD77826C20F5233790E","account_msid":"0","account_hashin":"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","account_hashout":"300A68CE06DA5EFF0B2073112FC6D883363CBDA34501478800733AC1EFA5083B","deduct":"0.00000000000","fee":"0.00000000000"},"account":{"address":"0009-00000000-9942","node":"9","id":"0","msid":"1","time":"1530782432","date":"2018-07-05 11:20:32","status":"0","paired_node":"9","paired_id":"0","local_change":"1530782432","remote_change":"1530782464","balance":"1788840.27676301502","public_key":"EFE862FA47E4BF2FA8A7F93F86734382998E7129594BC9A1E9C813A95099DD3E","hash":"57875A2AECB32B72DAA4A4709A083E8AD508C76C5FC53165ABB7F4913CB585A7"},"log":[{"time":"1530782464","date":"2018-07-05 11:21:04","type_no":"32768","confirmed":"yes","type":"node_started","node_start_msid":"0","node_start_block":"0","account":{"balance":"1788840.27692306690","local_change":"1530782432","remote_change":"1530782432","hash_prefix_8":"57875A2AECB32B72","public_key_prefix_6":"EFE862FA47E4","status":"0","msid":"1","node":"9","id":"0","address":"0009-00000000-9942"},"dividend":"-0.00020000000"},{"time":"1530782500","date":"2018-07-05 11:21:40","type_no":"32785","confirmed":"no","type":"bank_profit","profit":"-0.00000004188","node":"9","node_msid":"1"},{"time":"1530782500","date":"2018-07-05 11:21:40","type_no":"32785","confirmed":"no","type":"bank_profit","block_id":"5B3DE300","profit_put":"0.00000000000","profit_div":"0.00004000000","profit_usr":"0.00000000000","profit_get":"0.00000000000","profit":"0.00004000000","fee":"0.00000001000"}]}

11:21:42.378 [main] DEBUG net.adshares.ads.qa.util.LogChecker - NODE 9
11:21:42.378 [main] DEBUG net.adshares.ads.qa.util.LogChecker -         node_started:1788840.27672306690
11:21:42.378 [main] DEBUG net.adshares.ads.qa.util.LogChecker -          bank_profit:-4.188E-8
11:21:42.378 [main] DEBUG net.adshares.ads.qa.util.LogChecker -          bank_profit:0.00003999000
11:21:42.378 [main] DEBUG net.adshares.ads.qa.util.LogChecker - balanceObj: 1788840.27676301502
11:21:42.378 [main] DEBUG net.adshares.ads.qa.util.LogChecker - balanceArr: 1788840.27676301502
11:21:42.379 [main] DEBUG net.adshares.ads.qa.util.LogChecker - diff      : 0.00000000000
11:21:42.379 [main] DEBUG n.a.ads.qa.stepdefs.FunctionStepDefs - 0.00003999000
11:21:42.379 [main] DEBUG n.a.ads.qa.stepdefs.FunctionStepDefs - 0.00003994812

Function get_block returns value equal to the sum of all accounts' balance in node returned by get_account.
Balance returned by get_accounts seems to be one block delayed compared to get_account.