-
cornfeedhobo
cankerwort[m]: no
-
usamat
hello.
-
usamat
-
usamat
The CLSAG element is an array. It has only 1 index in this txn (e.g CLSAG[0])
-
usamat
When can there be multiple objects in the CLSAG array?
-
usamat
anyone?
-
mj-xmr
luigi1111w, Thanks anyway for merging my CCS. This will help in a different dimension.
-
marcus40
Is Monero's current LMDB configured to allow duplicate keys with different values?
-
moneromooo
Depends which table.
-
marcus40
Where is the table-specific setting for that in the code?
-
marcus40
or is it just enforced by flags in the mdb_cursor_put calls?
-
marcus40
I see this for example:
-
marcus40
#define MDB_APPEND 0x20000
-
marcus40
#define MDB_APPENDDUP 0x40000
-
marcus40
why, for example, do we store the block info like
-
marcus40
result = mdb_cursor_put(m_cur_block_info, (MDB_val *)&zerokval, &val, MDB_APPENDDUP);
-
marcus40
when the description for appendup says:
-
marcus40
Store multiple data items in one call. Only for #MDB_DUPFIXED.
-
moneromooo
grep lmdb_db_open in src/blockchain_db/lmdb/db_lmdb.cpp
-
marcus40
ah got you
-
marcus40
so the flags are set there?
-
moneromooo
The ones with DUPSORT allow duplicate keys.
-
marcus40
thanks
-
marcus40
what about storing the block info as i mentioned above
-
marcus40
why MDB_APPENDDUP? The description says we're storing multiple data items, but it seems that we're only storing one piece
-
moneromooo
Are you sure you're not thinking of MDB_MULTIPLE ?
-
marcus40
ah my mistake
-
marcus40
thanks
-
Yonatan[m]
What's your guy's thoughts on users providing hashpower as form of payment for a product/service?
-
Yonatan[m]
For example an online game that gives you in-game currency in the background in exchange for background mining
-
marcus40
That is not an example of your question
-
marcus40
the example has in game currency as the payment for the hashpower service
-
marcus40
I guess if you partnered with a game creator, you could have something like that though
-
marcus40
but few people would take hashpower as a payment
-
marcus40
because essentially it's a gamble on future volatility
-
marcus40
(of the price of whatever they're mining)
-
marcus40
But I guess if they really wanted the ingame currency and there was no easy way to get hold of it they might overlook that
-
moneromooo
I would like this to happen.
-
moneromooo
If you want to do something about this, please feel free.
-
hyc
hmmm. looks like randomx disabled_flags() isn't checked for FLAG_LARGE_PAGES
-
marcus40
is mdb_set_dupsort for sorting keys only?
-
moneromooo
Two things of interest: primo and... not sure what it's called, tevador made a layer above randomx that a browser can call/use.
-
hyc
tevador's randomx server, yah
-
moneromooo
-
moneromooo
It works for apache (web server) and firefox, but could work with anything where you want payment in return for a service really.
-
mj-xmr
An initial attempt to stabilize the functional_tests_rpc's mining test:
-
mj-xmr
-
selsta
mj-xmr: the problem is that it is difficult to test if this does indeed fix it
-
marcus40
hyc do you know why for txs_prubable_hash we define the dupsort like:
-
marcus40
mdb_set_dupsort(txn, m_txs_prunable_hash, compare_uint64);
-
marcus40
because when we do a put, we're putting in a hash
-
marcus40
mdb_cursor_put(m_cur_txs_prunable_hash, &val_tx_id, &val_prunable_hash, MDB_APPEND);
-
hyc
I didn't write that code, dunno
-
hyc
mooo did th pruning stuff
-
hyc
marcus40: a val_tx_id is a 64bit uint
-
hyc
not a hash
-
hyc
I see, the key should be uint64, the hash should be compare_hash32
-
hyc
could be a bug
-
hyc
moneromooo: ^^
-
hyc
fixing it would require full reload of the blockchain db
-
hyc
this bug means only 8 of 32byts of hash are being compared, so collisions could be possible
-
hyc
dunno the significance of that, dunno what txs_prunable_hash is for
-
xnbya
I have a question regarding RPC SSL, does anyone know if is there a reason that the wallet does not use the system ca list?
-
hyc
as I recall, the point is not to make nodes identifiable
-
hyc
using a public CA would defeat that purpose
-
mj-xmr
selsta: I have reproduced the problem by setting the timeout artificially to 1, and I got the same message.
-
selsta
mj-xmr: guess our best bet will be to merge it and wait if it shows up again
-
mj-xmr
I also observed the CPU load, and indeed, the RX takes all the cores on initialization, just like xmrig miner. If this power is taken up by other processes, it's very natural for the timeout to be too small.
-
hyc
marcus40: #7374
-
marcus40
yes
-
marcus40
that's right yeah....i thought it should be hash32
-
hyc
I'm going to dump my current DB and see if the change makes any difference on reimport
-
marcus40
do you mind if I PR it
-
marcus40
I am trying to contribute to Monero more
-
hyc
wdy mean, it is a PR already
-
marcus40
lol...
-
hyc
and it's not acceptable until we know the effect
-
hyc
impact
-
sethsimmons
About to publish a new blog post about how to contribute, would love any feedback (specifically on the "filing issues" and "for developers" sections) before I push it:
paste.debian.net/1185090
-
sethsimmons
Don't want to cause more harm than good 🙂
-
» hyc reads, ragequits .... :P
-
marcus40
PR already because you swooped in
-
marcus40
lol
-
marcus40
never mind :')
-
hyc
like I said, the PR isn't acceptable until we know what the impact will be
-
hyc
if there have been no collisions so far, then we're ok
-
marcus40
alright
-
hyc
have to check with moneromooo what the significance of this really is
-
marcus40
@hyc
-
marcus40
when we do mdb_set_dupsort
-
marcus40
that is for sorting keys only right?
-
hyc
set_compare is for keys
-
hyc
set_dupsort is for dup values
-
marcus40
on your commit why have you put two entries?
-
marcus40
There only needs to be one
-
hyc
both are needed
-
hyc
hmm.
-
hyc
I see, the DB is created with MDB_INTEGERKEY so set_compare is not needed
-
hyc
and the set_compare on txs_prunable is also not needed
-
marcus40
why does that preclude it from needing a compare?
-
hyc
MDB_INTEGERKEY already means compare the key as an integer
-
marcus40
just because it's the native format?
-
marcus40
ok
-
marcus40
got you
-
marcus40
hyc if i'm going to store say a std::string consisting of the concatenation of three std::strings , do I need to convert to a C string before putting it in the db for the string compare to work properly?
-
marcus40
sorry i meant if i have a string like that for BOTH the key and the value
-
hyc
you certainly cannot store std::string objects directly
-
marcus40
yeah, but is c_str the way to go?
-
hyc
LMDB doesn't do string compares
-
hyc
it does set-of-bytes-of-a-given-length compares
-
marcus40
BlockchainLMDB::compare_string
-
marcus40
( i know thats what's going on under the hood)
-
marcus40
but it's there, so would it make sense to just use that as the compare & dupsort?
-
marcus40
also you said that the dupsort's are for values
-
marcus40
but we're storing structures of block data here:
-
marcus40
MDB_val_set(val, bi);
-
marcus40
result = mdb_cursor_put(m_cur_block_info, (MDB_val *)&zerokval, &val, MDB_APPENDDUP);
-
marcus40
bi is a structure of block data
-
marcus40
but we have mdb_set_dupsort(txn, m_block_info, compare_uint64);
-
moneromooo
The data can be anything, but the key is uint64_t.
-
moneromooo
That table doesn't need to have duplicate keys I think.
-
moneromooo
So dupsort can be, er, whatever hte other one is.
-
moneromooo
compare IIRC
-
marcus40
but hyc said that dupsort is for keys
-
marcus40
sorry, for values
-
marcus40
and it takes a compare function as an argument
-
moneromooo
Using the system CA list would mean any random CA on the system could sign a cert the wallet would silently accept (at first approximation, it might not do so if we use IPs directly).
-
moneromooo
If you want to check the cert, whitelisting it is much safer. Then you know it's the right one, not one some random CA told you is OK.
-
moneromooo
But vtnerd added the ability to use system CAs later on.
-
moneromooo
MDB_INTEGERKEY bypasses the compare funcs. I didn't know that :/
-
moneromooo
dupsort is for values but it implies compare IIRC. hyc ?
-
hyc
dupsort only sets the comparator for the values
-
hyc
doesn't touch anything for the keys
-
marcus40
yeah so that's what I'm saying
-
marcus40
block info has values that are blobs of mixed data
-
marcus40
but the comparator is uint64_t
-
marcus40
what gives
-
moneromooo
OK, so it should be setting compare, not dupsort. Do you want to PR that marcus40 ?
-
moneromooo
The first element of the block info structure is a uint64_t. The key happens to be empty.
-
moneromooo
Setting compare or just remocing the useless dupsort. I don't mind either.
-
marcus40
ok, but just checking with you first
-
marcus40
MDB_val_set(val_bi, height);
-
marcus40
result = mdb_cursor_get(m_cur_block_info, (MDB_val *)&zerokval, &val_bi, MDB_GET_BOTH);
-
marcus40
if (result == MDB_NOTFOUND)
-
marcus40
{
-
marcus40
throw0(BLOCK_DNE(std::string("Attempt to set cumulative difficulty from height ").append(boost::lexical_cast<std::string>(height)).append(" failed -- difficulty not in db").c_str()));
-
marcus40
}
-
marcus40
else if (result)
-
marcus40
throw0(DB_ERROR("Error attempting to set a cumulative difficulty"));
-
marcus40
mdb_block_info *result_bi = (mdb_block_info *)val_bi.mv_data;
-
marcus40
mdb_block_info bi;
-
marcus40
bi.bi_height = result_bi->bi_height;
-
marcus40
bi.bi_timestamp = result_bi->bi_timestamp;
-
marcus40
bi.bi_coins = result_bi->bi_coins;
-
marcus40
bi.bi_weight = result_bi->bi_weight;
-
marcus40
//bi.bi_diff_lo = diff; // TODO
-
marcus40
bi.bi_hash = result_bi->bi_hash;
-
marcus40
MDB_val_set(val, bi);
-
marcus40
result = mdb_cursor_put(m_cur_block_info, (MDB_val *)&val_bi, &val, MDB_CURRENT);
-
marcus40
here it's using the height as the key , and the entire info as the value
-
moneromooo
Don't spam here. Put this on a paste ste please.
-
marcus40
sorry
-
moneromooo
paste.debian.net is nice.
-
marcus40
ok i will in future
-
marcus40
I guess here MDB_INTEGERKEY is accounting for the integer key
-
moneromooo
MDB_CURRENT means it'll add to what was found already.
-
marcus40
is it not bad that we dont have a dupsort?
-
moneromooo
I assume the size of the value is ignored here.
-
moneromooo
This one's always append, it's not sorted.
-
moneromooo
Well, it could be I guess since it's sorted by height...
-
marcus40
in other places, we only have result = mdb_cursor_put(m_cur_block_info, (MDB_val *)&zerokval, &val, MDB_APPENDDUP);
-
marcus40
no key this time?
-
moneromooo
A placeholder key looks like.
-
moneromooo
Well, real key, but empty.
-
moneromooo
So AFAICT it's not used in practice, the value is added at the end.
-
moneromooo
I'm getting a feeling I should let hyc address these things as he's the expert there
-
marcus40
no it is... if there is no key, constant 'zerokey' concatenated with the 'data' becomes the key to access the data
-
marcus40
however what i'm saying is some calls to put (m_cur_block_info
-
marcus40
are using a placeholder key and some aren't
-
marcus40
is that just because there are multiple types of data being stored in the same kvs?
-
moneromooo
In that table, no. Only the structure.
-
marcus40
I think I understand what might be happening
-
marcus40
But beings as we have no compator for the structure, that is prone to corruption right?
-
marcus40
we need a dupsort (tx, ......, compare_struct)?
-
marcus40
well compare_block_info
-
marcus40
I don't fully understand why yet, but it appears that
-
marcus40
(m_cur_block_info, (MDB_val *)&zerokval, &result, MDB_GET_BOTH);
-
marcus40
where result is the height
-
marcus40
allows you to pull a record created via:
-
marcus40
result = mdb_cursor_put(m_cur_block_info, (MDB_val *)&val_bi, &val, MDB_CURRENT);
-
marcus40
where val_bi is a height and val is the block data
-
marcus40
I guess it just means that (m_cur_block_info, (MDB_val *)&zerokval, &result, MDB_GET_BOTH); is equivalent to looking up by height
-
marcus40
@hyc
-
marcus40
if compare() is being used for comparing key in application vs key in database
-
marcus40
and dupsort is being used to compare values in application vs values in db, *when dupsort is enabled*
-
marcus40
what about when dupsort isn't enabled? where is our value comparator then
-
marcus40
or am I missing the purpose of dupsort
-
hyc
everything else in there is correct
-
hyc
so whatever you're looking at, you've probably overlooked something
-
marcus40
but what is used for value vs value comparison when we *dont* have dupsort enabled
-
hyc
please go read the LMDB docs
-
marcus40
i did
-
marcus40
it doesn't say
-
hyc
then use your brain
-
hyc
in a key value store, normally a key has only one value
-
hyc
since there is only one value, there is no need for a value comparator
-
marcus40
but i thought the purpose of the comparator was to check the application value thats searched for, versus what comes out of the db
-
hyc
that's not what a key value store does
-
hyc
you give it a key to search for, it give you the corresponding value - whatever it is
-
hyc
there is no comparison check on values in a normal k/v
-
hyc
but LMDB supports multiple sorted values per key, in dupsort tables.
-
hyc
ONLY in dupsort tables does it do value comparisons, and need a value comparator. which is what the set_dupsort function provides.
-
hyc
this is why the get option is called GET_BOTH - that means check both the key and the value
-
hyc
if you don't use GET_BOTH, the value is not checked.
-
marcus40
Right I see
-
marcus40
thanks very much I get it now
-
marcus40
I have one question then pertaining to monero
-
marcus40
for the block_info table, we're storing a data structure. why is the comparator a uint64_t
-
marcus40
the value comparator
-
marcus40
shouldn't there be a custom comparator for the block info structure
-
hyc
mooo already answered you. the first field of the struct is a uint64
-
hyc
the rest of the fields are irrelevant for matching purposes
-
marcus40
but that will laways be the same
-
marcus40
the first field is the height of the block
-
marcus40
(which is also the key)
-
hyc
there is only one block_info per block height so what's the problem?
-
hyc
there is only one block for a given height
-
marcus40
what about alt blocks that have the same height
-
hyc
they aren't in this table
-
marcus40
doesn't it store those in there too? orphans
-
marcus40
if there is only one block per height it shouldn't be dupsort in the first place then right?
-
marcus40
Am I ok to remove the dupsort( ... ..... ., uint64_t compare)
-
hyc
wrong and don't touch
-
marcus40
so no duplicate values... why dupsort?
-
hyc
Read the DB schema description more carefully
-
hyc
everything is already explained
-
moneromooo
Please try and be a bit less harsh, you're sounding like fireice sometimes :P
-
moneromooo
They're all duplicates. That table has a single key (that empty one I mentioned above).
-
hyc
this is all in the source already, these are stupid questions.
-
hyc
this is all *documented* already
-
moneromooo
It takes a while to grok everything.
-
hyc
-
moneromooo
And the empty key trick is not something you expect.
-
hyc
that's why it is explicitly documented there
-
hyc
and it's a cardinal sin to suggest changes to code that you haven't read thoroughly
-
moneromooo
What can I say. I'm a sinner...
-
marcus40
well i suggested one earlier and it turned out to be right
-
moneromooo
Do you mean it was just luck ? :)
-
hyc
lol
-
marcus40
you quickly lapped that up hyc eh
-
marcus40
haha
-
marcus40
but fair enough.... new to this part of the code
-
marcus40
I feel like the comments are often poor
-
marcus40
Not very clear/ thorough
-
marcus40
but thanks and see you
-
hyc
running an import now with the dupsort patch to see how different the DBs are
-
moneromooo
It should not matter, this call was pointless IIRC ?
-
moneromooo
That was for a non DUPSORT table, right ?
-
hyc
txs_prunable_hash is a dupsort table tho
-
hyc
is there only 1 hash per ID?
-
hyc
I guess that would be the case
-
hyc
ok now I see
-
hyc
there's no bug
-
mj-xmr
Oh bloody hell with that Copyright.
-
mj-xmr
#7334
-
hyc
the only thing I'd point out is that the txs_prunable_hash table is created as dupsort but doesn't actually have any duplicate values
-
hyc
so no bug, just a little misleading
-
moneromooo
Ah. I don't actually rememver how it works now...
-
hyc
it's a plain jane key/value table. key is txid, value is tx hash
-
moneromooo
OK, then dropping the flag seems like a good idea, yes.
-
hyc
it could have been setup as dupfixed to save some space
-
moneromooo
Can't recall.
-
hyc
but then it would have to do the key prefix trick etc. which it doesn't do
-
hyc
at this point we can't really change it. LMDB would complain on dbi_open that the flags are mismatched
-
hyc
(when opening an existing DB)
-
moneromooo
Oh I see.
-
moneromooo
vtnerd: around ?
-
vtnerd
yes
-
moneromooo
I'm replacing vector with span as you suggested, and I'm getting this:
-
moneromooo
-
moneromooo
The ctor I'm aiming for (const T*, size_t) can't be used due to safe_conversion being false.
-
moneromooo
But the struct is nothing fancy, just a struct { unsigned char[32]; }
-
moneromooo
Do you see why offhand ?
-
moneromooo
Line 4800 is now: return bulletproof_PROVE(epee::span<rct::key>(&sv, 1), rct::keyV(1, gamma));
-
moneromooo
(the second one will be a span too after this is sorted)
-
vtnerd
it looks like const-correctness for at least some of the errors. `epee::span<const rct::key>(&sv, 1)` -> mismatched types `rct::key [N]` and `const rct::key*`"
-
vtnerd
well it wouldn't use that overload, but thats the first set of errors
-
moneromooo
Oh right. That's one thing that confused me earlier, vector doesn't work like this. Thanks.
-
vtnerd
oh I think the other errors are saying it cannot call the other overload
-
moneromooo
Indeed, it was just that. I should have worked it out -_- Thanks.
-
nojlbbibsm
FIY, you want to know why you are getting those daily messages? Cults NEED to control information. That's why people like lh1008 get savagly attacked (also called disconnection) for even talking to me. Break the information embargo, break the cult. Who would sign up to Scientology if they knew from the get-go that is is about a sci-fi alien overlord? Who would sign up to MAGA if they knew what a loser
-
nojlbbibsm
Trump is?
-
nojlbbibsm
You don't sign up to MAGA to do a failed Viking LARP and some time off in club fed. You sign up because you feel like shit and they promise to give you self-respect. It is a total lie of course, you are still a joke even when cosplaying a Viking. Just like Monero's promise of privacy is a lie.
-
moneromooo
OMFG, fuck this waste of time for just two extra fucking cycles -_-
-
moneromooo
Fucking spans. They can go in later.
-
» moneromooo undoes
-
vtnerd
it wasn't an easy transition? and its probably way more than two cycles given the allocation
-
moneromooo
Sure, but it's one alloc for the whole of PROVE or VERIFY. De minimis.
-
moneromooo
And no, not easy. span is missing a ctor from const U* AFAICT, but adding it did not help either.
-
moneromooo
I mean, it might be easy when you're used to C++ery, but it's wasting my time.
-
moneromooo
And I'll be back in an hour when the tests have run with the remaining changes.
-
» moneromooo grumbles
-
omega
how to debug this monero-wallet-rpc error? Error calling gettransactions daemon RPC: r 1, status <error>
-
vtnerd
why does it need another constructor? none of those types have bases for conversion
-
moneromooo
It has a ctor with U * const src_ptr, but none with const U *src_ptr
-
moneromooo
So if you have a const object to start with, &object will be const, and so can't bind AFAIK.
-
moneromooo
Anyway, I reset and redid the other changes. If you want to switch to span later, you're welcome (also in bulletproofs, which has vectors too).
-
moneromooo
But it's just taking me way too much time for not much gain.