cliri
cliri copied to clipboard
getConfidences is too slow
When I use the command, it can take minutes to get an response, even if the transactions aren't very old. Maybe we can use "local milestones" to optimize that as Mathieu Viossat described: "I'm not sure how to explain what I mean by "local milestones". Bascially, the node itself would elect a small percentage of txs to be local milestones. "local" only means different nodes can have different local milestones. Depending on the implementation, local milestones may represent a chain (like with the current mainnet milestones), or a Tangle, or just a tree."
Link to the whole discussion: https://discordapp.com/channels/397872799483428865/548095959842684928/553170046399283201
I do some test. test code:
#!/bin/bash
while 1>0
do
echo '\n' >> TestgetConfidences
date >> TestgetConfidences
echo '\n' >>TestgetConfidences
curl http://p02.zeronet.iota.cafe:14265 -X POST -H 'Content-Type:application/json' -H 'X-IOTA-API-Version: 1' -d '{"command":"getConfidences","transactions":["WBHTOYOSBNGWA9GIRATL9NSTVTRGTMTWU9BSUPLADZLCVIWAYN9XSZKLAVPSVE9KSLNWFR9CDHAFHA999"] }' >> TestgetConfidences
done
some test result:
start: Sat Mar 9 17:35:22 CST 2019:{"confidences":[1.0],"duration":2176}\n
min duration : Sat Mar 9 17:59:15 CST 2019:{"confidences":[0.0],"duration":135}
error : Sat Mar 9 18:06:04 CST 2019:{"error":"The selected entry point\u0027s subtangle size is too big. EntryPoint Hash: 999999999999999999999999999999999999999999999999999999999999999999999999999999999 Subtangle size: 273470","duration":60812}
max duration: Sat Mar 9 18:07:06 CST 2019:{"error":"The selected entry point\u0027s subtangle size is too big. EntryPoint Hash: 999999999999999999999999999999999999999999999999999999999999999999999999999999999 Subtangle size: 273741","duration":151108}
end: Sat Mar 9 19:30:11 CST 2019:{"confidences":[1.0],"duration":8066}
Test result is too big , so I don't record all.
If you use a tip with getConfidences it takes forever and returns nothing
Another testresult for a 4 days old tx { confidences: [ 1 ], duration: 3354161 }