Maintain an auxillary state locally to reduce the bandwidth#144
Maintain an auxillary state locally to reduce the bandwidth#144
Conversation
b35ef1b to
a4a064f
Compare
8913f30 to
a677628
Compare
axman6
left a comment
There was a problem hiding this comment.
Looks interesting, I hadn't considered this approach. Just making sure I understand, we're basically keeping the UTxO map in memory, but filtered to only scripts? Any idea what effect this has on memory? I imagine it's not too bad (and if we really need to bring memory usage down, we could specialise things).
Does this handle the case where a script is added to the ledger after the app starts? That will be the common case when starting from genesis. I couldn't quite follow how the scan was working.
I assume the big pay off here is that we now know when a script uses a script that we care about so only need to request UTxO state when we see that, and not for every block?
Yes, we start with some valid utxo map and incrementally build it while going through blocks.
I'm not sure what this means. Do you mean specialise a function?
Yes. TLDR: Invariant on the local UTxO map: It only contains the UTxOs with script addressess that have an intersection with the configured scripts. The PSR can start at any chainpoint. When it start we create the local UTxO map.
Yes. 2 big pay offs:
|
| #!/usr/bin/env bash | ||
|
|
||
| while true; do | ||
| clear | ||
| curl -s http://localhost:8090/metrics | | ||
| grep -v -E '^(#)' | | ||
| awk '{ printf "\033[1;36m%-60s\033[0m \033[1;33m%s\033[0m\n", $1, $2 }' | ||
| sleep 1 | ||
| done |
There was a problem hiding this comment.
Will we use this?
We can remove this now and maybe add this on demand,
There was a problem hiding this comment.
I think we can keep it
axman6
left a comment
There was a problem hiding this comment.
LGTM! Great work, this should really improve how often we query the node.
Closes: #122