-
nantuk[m]
Hi guys, as far as I know, xmr->btc atomic swaps cannot be implemented correctly until Monero adds transaction pre-signing (read this in a commit blog post). Does anyone know if this will be added in the next hard fork?
-
nantuk[m]
-
UkoeHB
nantuk[m]: for transaction chaining (needed for xmr->X swaps) Monero would need to fork to something like seraphis (WIP next-gen tx protocol), which is at least 2 years away probably.
-
nantuk[m]
<UkoeHB> "nantuk: for transaction chaining..." <- Oh all right, thanks
-
kayabaNerve
get_fee_quantization_mask is static and will be until we have a major fee overhaul, so I can ignore it as an RPC value and instead write it as a constant myself... right?
-
kayabaNerve
The only other consideration that may be relevant is if the unit fees UkoeHB proposed would be automatically applicable by wallets if they do operate with the RPC returned mask properly (setting the mask to 1 and the fee per kb to 1/2/... as well).
-
r4v3r23[m]
jberman: thanks for taking on 7760 rewrite as node performance is greatly improved on it. will it make it into v0.18 or is there not enough time to get it in?
-
jberman[m]
r4v3r23: Not necessarily working on a rewrite, just working through understanding it in full to review it. I think I'll be done in the next couple days but possibly not
-
jberman[m]
<kayabaNerve> "get_fee_quantization_mask is..." <- It should be but note the upcoming fork modifies the fee algo, which you're going to want to make the RPC call to get_fee_estimate for, which returns the quantization mask anyway
-
sech1
hyc I think we have a problem with lmdb in the latest master
-
sech1
I'm debugging broken solo mining in xmrig when ZMQ is enabled
-
sech1
this is what I get on monerod side:
paste.debian.net/hidden/d3297b7c
-
sech1
so the blockchain height changes to 2644329 at 18:11:56.104 because new block was added
-
sech1
but then it starts changing between 28 and 29 erratically
-
sech1
xmrig calls get_block_template RPC as soon as it gets new block ZMQ notification, and get_block_template returns 2644328 instead of 2644329
-
sech1
-
sech1
but the root cause of what's happening is beyond my understanding
-
sech1
and this is 100% reproducible. Every single new block - the same behavior
-
selsta
and it doesn't happen in release-v0.17 ?
-
sech1
release-v0.17 works fine
-
selsta
how long does it take to reproduce the issue?
-
sech1
100% reproducible
-
selsta
bisect.. again :D
-
sech1
I just start mining solo xmrig with ZMQ enabled
-
sech1
and wait for next block
-
sech1
and boom!
-
sech1
I can bisect, but maybe hyc can recognize this behavior?
-
selsta
there is a different issue on reorgs, maybe they are related
-
moneromooo
It's not the same thread, so each thread will have a different view of hte db until the txn commit. Did you account for this ?
-
moneromooo
"release-v0.17 works fine" suggests yes, but... just making sure :)
-
sech1
I didn't account for this
-
sech1
so calling get_block_template immediately after is not safe?
-
moneromooo
It depends after what.
-
sech1
after handle_block_to_main_chain
-
moneromooo
If calling on hte same thread, it'll be fine.
-
sech1
so handle_block_to_main_chain sends miner notification to xmrig, xmrig calls get_block_template RPC immediately
-
sech1
and this RPC accesses db on another thread, right?
-
sech1
so it's not safe?
-
moneromooo
If handle_block_to_main_chain hasn't commited the db txn yet, it's not safe.
-
moneromooo
But a process creation etc is slow, so...
-
moneromooo
If the miner notification is synchronous, it's definitely not safe. If async, it's not safe, but probably ok in practice.
-
moneromooo
So not OK :D
-
sech1
what process creation? It's ZMQ pub send
-
moneromooo
This is probably an existing monero bug I think...
-
sech1
so a few bytes over TCP connection
-
moneromooo
Oh. I'm not familiar with those. I'm familiar with the execve one.
-
sech1
it's sent in the end of handle_block_to_main_chain, already after m_db->add_block() succeeded
-
moneromooo
So I'm guessing zmq exacerbates then.
-
moneromooo
And I'm guessing there's a dtor that commits at scope end ?
-
moneromooo
Hmm. Seems unlikely, IIRC commits are explicits... Anyway, worth checking.
-
sech1
I'm bisecting now (going one month back at a time, recompiling and testing)
-
selsta
if you start with master~300 you will have to do 8 compiles
-
selsta
did it yesterday to find the glibc commit
-
moneromooo
9 at most... Sorry for pedantic, but... :D
-
moneromooo
I think. Maybe. Off by ones are sooooo programmerese...
-
selsta
hmm yes 9, 8 if you start with master~255
-
sech1
commit 0f7b20a1ce5510ea730ce3ec6454ef4822309a51 (end of March) works
-
sech1
I'll keep looking
-
ooo123ooo1234567
monero-project/monero #7937 - this is the only one directly related to src/rpc or src/cryptonote_core
-
selsta
sech1: works as in doesn't have the issue?
-
sech1
yes
-
selsta
sech1: not sure if you have ooo on ignore but it might be
monero-project/monero #7937
-
selsta
it would fit date wise
-
sech1
I'm already bisecting around the date it was merged
-
ooo123ooo1234567
<r4v3r23[m]> "jberman: thanks for taking on 77..." <- there are examples when less isolated changes merged without proper review and the main benefit of 7759/7760 isn't node performance (I didn't even measure speed of anything) and it must be included even before v0.18 and v0.18 has bigger troubles except broken connection code, not sure how explicit request for reviews will speed up it;
-
r4v3r23[m]
<ooo123ooo1234567> "there are examples when less..." <- all i know is that nodes running 7760 are much more stable
-
ooo123ooo1234567
r4v3r23[m]: unfortunately this level of understanding doesn't reflect all benefits from that patch
-
r4v3r23[m]
im just a user, i dont need to understand. ever since using selsta's node my connections have been rock solid
-
ooo123ooo1234567
it's like you're approaching some fundamental improvements and someone judging it by cover (code style), it only emphasize level of understanding of those who are reviewing
-
kayabanerve[m]
<jberman[m]> "It should be but note the..." <- Mind elaborating? I wasn't aware of this.
-
kayabanerve[m]
My issue with get_fee_estimate is it's not reproducible.
-
kayabanerve[m]
My issue with the quantization mask is no one else on the planet uses it so I either need to craft custom code handling OR isolate it in Monero, which I know I can do so long as it's static.
-
kayabanerve[m]
So if I'm already writing my own fee algorithm implementation, and the mask is static... that's when the question is raised of why am I calling g_f_e
-
jberman[m]
-
kayabanerve[m]
kayabanerve[m]: And this is a non-starter which can't be worked around without patches to monerod :/
-
kayabanerve[m]
jberman[m]: Thanks
-
ooo123ooo1234567
<r4v3r23[m]> "im just a user, i dont need to..." <- it's supposed to be used on every node, every time you're falling back to centralized solutions it harms in long term
-
sech1
selsta yes,
monero-project/monero 83bb027 is where the behavior changed
-
sech1
previous commit works, this one doesn't
-
sech1
or I'd rather say both work, it's just xmrig that needs to change how it calls get_block_template
-
ooo123ooo1234567
sech1: wow
-
ooo123ooo1234567
sech1: indeed, it's a try to justify whatever is needed to be justified, the same as with unbound: previously ubuntu 16 is sad, after ubnuntu 16 is 1 year after eol
-
selsta
sech1: should we undo 83bb027?
-
sech1
of course not
-
sech1
btw p2pool isn't affected by this because it uses miner notifications sent from the same thread
-
selsta
i mean if it's buggy behavior on monerod then reverting is better than a workaround on xmrig. if it was just an implementation issue with xmrig then it's fine.
-
sech1
I don't think it's buggy
-
sech1
get_block_template maybe should be fixed to wait for db lock before proceeding
-
sech1
I already have a workaround for xmrig
-
sech1
jberman[m] should look into it, I'm not familiar with the db code
-
sech1
it's not buggy per se - get_block_template returns old block template if called before db is ready with the new data. So it's correct from RPC point of view
-
sech1
but adding a lock there would improve it
-
moneromooo
Yes, best to set a flag instead of calling, and call in cleanup_add_blocks if the flag is set.
-
moneromooo
There's already a similar flag, forgot what I added it for, but similar thing.
-
ooo123ooo1234567
<sech1> "but the root cause of what's..." <- How would you describe the root cause ?
-
sech1
cleanup_add_blocks? I can't find it
-
ooo123ooo1234567
<sech1> "but adding a lock there would..." <- or not improve, what is the root cause ?
-
» moneromooo goes look
-
sech1
ooo123ooo1234567 you're on my ignore list. I just checked libera logs and I see I saved a lot of time by not seeing your comments. 99% garbage as usual
-
moneromooo
cleanup_handle_incoming_blocks
-
moneromooo
I'm reasonably sure this gets called for locally found blocks. Double check though.
-
ooo123ooo1234567
sech1: There is a fix for ubuntu 16 compatibility , and comment with link to patch related to db, all are garbage ?
-
ooo123ooo1234567
you're just following crowd, it isn't about garbage or not garbage and don't want to admit it
-
sech1
yes, it's for embedded miner
-
sech1
core::handle_incoming_block doesn't call it
-
moneromooo
Right. It's called after it.
-
moneromooo
prepare/handle/cleanup.
-
moneromooo
If succesful. cleanup isn't called on error.
-
ooo123ooo1234567
1st question is how blackbox patch with lmdb locks in high layer of rpc changed something for rpc calls - there is certainly some overlook, 2nd question - are there any benefits from lmdb locks in rpc, it's certainly not long term solution for race conditions
-
ofrnxmr[m]
"1st question is how blackbox patch with lmdb locks in high layer of rpc changed something for rpc calls - there is certainly some overlook, 2nd question - are there any benefits from lmdb locks in rpc, it's certainly not long term solution for race conditions"
-
ofrnxmr[m]
-ooo123
-
ooo123ooo1234567
zmq notification within src/cryptonote_core/blockchain.cpp is done before commit of tx into db, it's possible to reorder it, but why rpc patch with lmdb locks added some inconsistency if it was supposed to improve something
-
ofrnxmr[m]
"zmq notification within src/cryptonote_core/blockchain.cpp is done before commit of tx into db, it's possible to reorder it, but why rpc patch with lmdb locks added some inconsistency if it was supposed to improve something"
-
ofrnxmr[m]
--ooo123
-
sech1
ooo123 clearly didn't read the code
-
ooo123ooo1234567
sech1: if you is going to read code before submitting the next PR then I would be very happy
-
ooo123ooo1234567
s/is/are/
-
ooo123ooo1234567
sech1: as soon as someone will submit patch it will be possible to test: correct patch can't be written without code reading with high probability
-
sech1
get_block_template holds m_tx_pool lock, and this lock is released in cleanup_handle_incoming_blocks, so all should be good. Need to wait for jberman[m] to clarify what is happening there
-
ooo123ooo1234567
<sech1> "ooo123ooo1234567 you're on my..." <- libera logs doesn't contain referenced msg in reply (it's visible only on matrix side in the worst case)
-
sech1
*Blockchain::create_block_template holds m_tx_pool lock
-
ooo123ooo1234567
<sech1> "get_block_template holds..." <- read code, it's the best clarification tool
-
ooo123ooo1234567
<sech1> "get_block_template holds..." <- I've found the root cause
-
ooo123ooo1234567
indeed, it's due to those low level lmdb locks added into high level rpc
-
ooo123ooo1234567
* level lmdb "locks, * locks" added
-
ooo123ooo1234567
<ooo123ooo1234567> "1st question is how blackbox..." <- 1st question answered, 2nd question - it's more harm than benefits since db should be fixed from bottom to top without adding intrusive db "locks" into high layer blindly
-
ooo123ooo1234567
<ooo123ooo1234567> "zmq notification within src/..." <- reordering will not help, it's clear now why rpc patch mad it something worse
-
ooo123ooo1234567
s/mad/made/
-
ooo123ooo1234567
s/mad/made/, s/it//
-
ooo123ooo1234567
how is it garbage if these question helped with understanding of the problem ?
-
sech1
"db should be fixed from bottom to top" -> usual garbage comment from ooo123, this is why you're on ignore
-
sech1
I've found the root cause too
-
sech1
db_rtxn_guard is locked in before the new data is fully commited to the db
-
sech1
no need to rewrite db, and the db guard is correct there
-
sech1
before, it would be executing in parallel with db update
-
ooo123ooo1234567
<sech1> ""db should be fixed from..." <- it's impossible to use low level locks in high layer with encapsulated objects, in the worst case it could be deadlock / race condition / consistency
-
sech1
the sequence of events uncovered with printf-debugging:
paste.debian.net/hidden/f3e2f195
-
ooo123ooo1234567
<sech1> "no need to rewrite db, and the..." <- it's possible that db guard will be there in final version, but only after all layers below are fixed, not before
-
ooo123ooo1234567
sech1: I've just read code to understand it
-
sech1
so it's correct that get_block_template returns old data and the db guard prevented returning possibly incosistent data
-
ooo123ooo1234567
sech1: consistency is expected across all api from daemon, it isn't consistent to see different from zmq and rpc
-
ooo123ooo1234567
events may be asynchronous (it's needed for speed), but they should be consistent in order to be reliable for external user
-
sech1
this can be fixed by moving db_rtxn_guard after m_tx_pool.lock(); inside create_block_template
-
sech1
trying it now
-
hyc
it would certainly be bad practice to take a db lock long before it's needed
-
ooo123ooo1234567
sech1: it means move db_rtxn_guard (added blindly in 7937) from core_rpc_server::on_getblocktemplate into Blockchain::create_block_template
-
sech1
yes, it takes the db lock and then waits for m_tx_pool.lock() for a long time
-
sech1
yeap, moving db_rtxn_guard to the right place works like a charm
-
sech1
PR soon
-
ooo123ooo1234567
sech1: wow, so once you've found the root cause it was possible to fix it; so unexpected
-
ooo123ooo1234567
sech1: 7937 is still good ? any new arguments ?
-
ooo123ooo1234567
hyc: it isn't about good/bad practice, it's about understanding what is going on; in the worst case bad/good practice may be not appropriate
-
ooo123ooo1234567
<sech1> "so it's correct that get_block_t..." <- so correct that it was required to move "lock" from rpc into blockchain class
-
sech1
regarding 7937, it needs to be checked for other places where lock duration can be reduced
-
ooo123ooo1234567
monero-project/monero #7936, it should be replaced with more consistent methods for core/blockchain classes since it deeply depends on their internals
-
ooo123ooo1234567
and not with "locks" in rpc
-
ooo123ooo1234567
sech1: no, reverted and then added separate methods for core/blockchain which will hold appropriate locks where it's needed without inconsistency
-
ooo123ooo1234567
sech1: it isn't about performance optimization to reduce time for lock being held, but about consistency in api (it's much bigger problem in scope)
-
ooo123ooo1234567
> <@sech1:libera.chat> regarding 7937, it needs to be checked for other places where lock duration can be reduced
-
ooo123ooo1234567
* it isn't about performance optimization to reduce time for lock being held, but about consistency in api (it's problem with much bigger scope)
-
sech1
who said anything about performance optimizations? I meant lock scope, not duration. This issue was particularly because lock order was wrong. Every place where DB read lock is taken needs to be examined to check where the data is being updated and what locks are held in those places.
-
ooo123ooo1234567
<sech1> "regarding 7937, it needs to be..." <- just think: core is an abstract lib with all hard calls that could be used by different apis (rpc / zmq / ...), these calls should be made consistent within core, not within rpc
-
ooo123ooo1234567
* / ... / p2p), these
-
sech1
-
sech1
selsta moneromooo ^
-
ooo123ooo1234567
sech1: 7937 added "locks" blindly, now you're placing one of them into right place and asking for review and ignoring bigger issue which is clear from problem investigation; facepalm
-
ooo123ooo1234567
funny that 7937 started from
monero-project/monero #7936, which started from few irc comments; just facepalm
-
sech1
There's no bigger issue. Added you on ignore again, you're unbearable. Look, we all know that you like facepalming and solving everything by rewriting from top to bottom. Just stop. While you're facepalming, I solved the issue at hand.
-
ooo123ooo1234567
sech1: zmq is an api but called within core, rpc is an api but called outside of core; at the same time someone is adding db "lock" into an api (rpc) in order to have consistent view on core calls, but different api returns different view; it is inconsistent behaviour
-
ooo123ooo1234567
<sech1> "There's no bigger issue. Added..." <- solved one small scope issue, but advocated for preserving of incorrect patch + advocated for not wise fixes in long term for similar issue + not admitted that 7937 is a wrong way; it's more harm than good
-
ooo123ooo1234567
the problem is that it isn't just you, but many things at once, and when I'm talking about one of them it leads to pointless ping-pong where no one is responsible for anything
-
ooo123ooo1234567
sech1, even if you're acting in good faith it allows to hide some problems, it's bad in long term
-
ooo123ooo1234567
<sech1> "There's no bigger issue. Added..." <- btw, "it's from bottom to top"; hahahahaha
-
ooo123ooo1234567
<sech1> "There's no bigger issue. Added..." <- and it isn't applicable for everything, in that particular it's possible to do small careful changes before full rewrite, but not blind changes in high layer without understand low layer
-
MeowingCat
what is wrong with wallet2???
-
ooo123ooo1234567
s/"//, s/"/, nobody is doing rewrites from top to bottom/
-
MeowingCat
Windows Defender saw that as a virus
-
MeowingCat
idk why now
-
MeowingCat
but it was not recognizing wallet2 as a virus
-
MeowingCat
but it did
-
ooo123ooo1234567
it looks like reproducible problem, try to bisect
-
MeowingCat
maybe about runtime security but it is interesting because
-
MeowingCat
it was same
-
ooo123ooo1234567
<sech1> "There's no bigger issue. Added..." <- btw, +1 for finished bisection, it was useful work anyway
-
MeowingCat
my code was same to yesterday
-
MeowingCat
and this morning Windows Defender decided it is a virus
-
MeowingCat
i rebuild it after that
-
MeowingCat
it was working
-
MeowingCat
but now it is not getting blocks
-
MeowingCat
Monero made me really crazy
-
UkoeHB
MeowingCat: can you try to put more of your thoughts in one comment? Instead of 100 separate sentence fragments. Also, filter out the ones we don't care about
-
MeowingCat
you can try not to be rude instead
-
ooo123ooo1234567
MeowingCat: that's just personal spam protection before adding someone into personal ignore list, not global rule
-
ofrnxmr[m]
Still. Put your thoughts together before hitting the enter button.
-
ofrnxmr[m]
Tip: use periods [ . ] MeowingCat: