<sugarpuff_>
Thanks michaelfolkson, I don't think anyone will answer that email, and my questions aren't directed to Jack Dorsey :P.
<sugarpuff_>
prayank nipped out before finishing what he wrote... Greg Maxwell no longer contributes to bitcoin - isn't that because of the lawsuit? If so, then Craig can continue to sue the remaining developers and kick everyone out if nobody goes to court against him. I don't think anyone here can really give me an answer, since this is a decision they have to make on their own (or together), but I just wanted to share my
<sugarpuff_>
thoughts, etc.
<sipa>
This is off-topic
sipsorcery has joined #bitcoin-core-dev
rex4539 has joined #bitcoin-core-dev
brunoerg has joined #bitcoin-core-dev
brunoerg has quit [Ping timeout: 256 seconds]
Aaronvan_ has quit [Quit: Leaving...]
bomb-on has quit [Quit: aллилѹіа!]
sipsorcery has quit [Ping timeout: 268 seconds]
bitdex has joined #bitcoin-core-dev
jonatack has joined #bitcoin-core-dev
BUSY has quit [Read error: Connection reset by peer]
<jeremyrubin>
sort of weird b/c we use once_flag and call_once in other places in the code, so it looks like we're somehow linking with the wrong options?
brunoerg has quit [Remote host closed the connection]
brunoerg has joined #bitcoin-core-dev
<laanwj>
jeremyrubin: that's a 5 year old issue, i'm sure it's no longer relevant? we've been using the posix variant since forever
<laanwj>
jeremyrubin: IIRC libbitcoin_consensus isn't linked against pthread intentionally, it's not supposed to be threaded
<laanwj>
because it could be used from non-threaded C code, or code using some completely different threading model
brunoerg has quit [Remote host closed the connection]
brunoerg has joined #bitcoin-core-dev
arythmet_ has quit [Remote host closed the connection]
<laanwj>
i'd agree "using C++ synchronization primitives" isn't threading in itself, but apparently it does cause linking to one
<jeremyrubin>
laanwj: ok that makes sense I guess, but it's problematic slightly since the scriptchecks generated are designed to be threadsafe so i wanted to ensure that i had a low cost way to do cache on first use... but it sounds like that's troublesome no matter what I do (mutex, atomic, etc)
<laanwj>
right-even atomic isn't guaranteed, on some platforms it can be done with instructions, but on others it does need support from the OS through a threading library
<jeremyrubin>
i thought c++ requires atomics OR proof no threads are used otherwise things like static init are broken?
<laanwj>
any caching would have to be done at a higher level
<jeremyrubin>
hmm that seems like a boundary violation
<jeremyrubin>
this caching is required for validation to be correct
<laanwj>
not in the consensus code itself, i think it makes sense from the perspective that libbitcoin_consensus is supposed to be stateless too
<laanwj>
wait, no, consensus never should need caching between validations to be correct
<jeremyrubin>
PrecomputedData is required for correctness
<jeremyrubin>
where correctness includes runtime
arythmetic has joined #bitcoin-core-dev
<jeremyrubin>
you don't need caching between validations, but you do need caching of validation data to prevent quadratic hashing
<laanwj>
in that case isn't there another way to manage the context
<laanwj>
like, cache it within a call somehow instead of between them
<jeremyrubin>
no, because that reintroduces quadratic hashing
<jeremyrubin>
N inputs having to do a N sized computation ==> N^2
<jeremyrubin>
laanwj: the way to get rid of it is to just always pre-compute, rather than cache on first use, but that has an overhead if you don't use the cache at all
<jeremyrubin>
which was feedback from jamesob to not do that
<sipa>
libbitcoinconsensus right now doesn't even support taproot
<jeremyrubin>
one thing we could do is make PrecomputedData an abstract base class
<jeremyrubin>
and have getter methods for the fields
<jeremyrubin>
errr
<sipa>
and the single-call per input model that libbitcoinconsensus has is inherently vulnerable to quadratic hashing
<jeremyrubin>
make the BIP119LazyInit function defined by users of the abstract base
arythmetic has quit [Ping timeout: 240 seconds]
brunoerg has quit [Remote host closed the connection]
<jeremyrubin>
another option would be to make precomputeddata take a lambda for BIP119LazyInit
<jeremyrubin>
that's the smallest code change impact I guess?
<jeremyrubin>
and if no lambda provided, it should just compute the things eagerly
<jeremyrubin>
that would force the sync responsibility up the stack.
<laanwj>
agree, the libbitcoinconsensus API which is too low-level for most purposes, the libbitcoin_kernel model does allow for threading, caching etc, but we don't have it yet
brunoerg has joined #bitcoin-core-dev
<jeremyrubin>
i'm somewhat indifferent as to what the right path is, be it to just always cache for now (small performance impact), to do a lambda pass wrapping call_once, to enable linking pthread, or to do something more sophisticated. i'll go with the flow on it, care more about adressing jamesob feedback ultimately
<jeremyrubin>
also maybe possible to write a basic call_once alternative using just atomics (which might not have the same link error) and then wrap it based on platform?
brunoerg has quit [Remote host closed the connection]
gnaf has joined #bitcoin-core-dev
pergaminho has quit []
<laanwj>
passing in a lambda could work i guess if it's optional (in the case of libbitcoin_consensus use it would be empty), i don't like platform specific workarounds
arythmetic has joined #bitcoin-core-dev
niska has quit [Quit: Leaving]
brunoerg has joined #bitcoin-core-dev
arythmetic has quit [Ping timeout: 256 seconds]
brunoerg has quit [Ping timeout: 268 seconds]
goatpig has joined #bitcoin-core-dev
niska has joined #bitcoin-core-dev
ZeroMaster has quit [Ping timeout: 240 seconds]
lucasdcf has joined #bitcoin-core-dev
lucasdcf has quit [Client Quit]
brunoerg has joined #bitcoin-core-dev
<jamesob>
jeremyrubin: I like the sound of the lambda pass, maybe that's worth trying
brunoerg has quit [Ping timeout: 240 seconds]
Guyver2 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
ZeroMaster has joined #bitcoin-core-dev
ZeroMaster has quit [Ping timeout: 240 seconds]
ZeroMaster has joined #bitcoin-core-dev
Talkless has joined #bitcoin-core-dev
brunoerg has joined #bitcoin-core-dev
vysn has quit [Ping timeout: 240 seconds]
brunoerg has quit [Ping timeout: 240 seconds]
jonatack has quit [Quit: Connection closed]
sheb has quit [Quit: Leaving]
brunoerg has joined #bitcoin-core-dev
jonatack has joined #bitcoin-core-dev
brunoerg has quit [Remote host closed the connection]
goatpig has quit [Remote host closed the connection]
brunoerg has joined #bitcoin-core-dev
arythmetic has joined #bitcoin-core-dev
arythmetic has quit [Ping timeout: 240 seconds]
brunoerg has quit [Remote host closed the connection]
ZeroMaster has quit [Ping timeout: 240 seconds]
ZeroMaster has joined #bitcoin-core-dev
brunoerg has joined #bitcoin-core-dev
brunoerg has quit [Remote host closed the connection]
brunoerg has joined #bitcoin-core-dev
brunoerg has quit [Remote host closed the connection]
backes has joined #bitcoin-core-dev
<backes>
hey, is 70016 the latest protocol version?
brunoerg has joined #bitcoin-core-dev
meshcollider has quit [Changing host]
meshcollider has joined #bitcoin-core-dev
brunoerg has quit [Ping timeout: 240 seconds]
arythmetic has joined #bitcoin-core-dev
brunoerg has joined #bitcoin-core-dev
arythmetic has quit [Ping timeout: 240 seconds]
backes has quit [Ping timeout: 250 seconds]
sipsorcery has quit [Ping timeout: 250 seconds]
gnaf has quit [Quit: Konversation terminated!]
backes has joined #bitcoin-core-dev
brunoerg has quit [Remote host closed the connection]
backes has quit [Ping timeout: 240 seconds]
<jeremyrubin>
so the approach ends up a little convoluted API wise, but I think it gives us everything we wanted:
<jeremyrubin>
Lambda for caching, which can use call_once (used from CheckInputsScripts), force option just precomputes it always (threadsafe), and no lambda + no force gives you a default cache on first use which is not thread safe. You can make a PrecomputedData with a lambda, or pass to init, but if you do both we don't allow overriding (since it's probably a