-
jeffro256[m]
Hey y’all I was joking earlier about Monero having it’s Y2K moment, but I think I actually found a future bug. LMDB uses a uint64_t to store the cumulative number of coins up to a given block height in mdb_block_info. That value is going to overflow in about 1.8 years. At that point, tx fee verification is undefined
-
jeffro256[m]
The method interface that accesses that value is BlockchainDB::get_block_already_generated_coins and the Blockchain::check_fee method is used to allow/disallow transactions to enter the mempool so the network might come to a grinding halt when that happens
-
sech1
No, it's just a 64-bit value that gets capped to 2^64 - 1
-
sech1
it's used to calculate block reward, so values >= 2^64 are not needed
-
sech1
-
jeffro256[m]
Thanks for the pointer :)
-
jeffro256[m]
That’s a weird way to do it but I guess it works
-
jeffro256[m]
That’s good to know
-
sech1
And it's less than a year until it reaches 2^64 - on June 6, 2024 by my calculations.
-
jeffro256[m]
I was using coin gecko’s total supply number which I think is behind
-
Pascal123
Hello Guys
-
Pascal123
i hope you are doing well :)
-
Pascal123
Could someone tell me, why this simple call to monero daemon not works? its such a simple call, but the daemon does reply nothing...
-
Pascal123
{"jsonrpc":"2.0","id":0,"method":"get_block_header_by_height","params":{"height":912345}}
-
Pascal123
,please
-
Pascal123
i m connecting via tcp socket
-
sech1
No one can tell you because you didn't tell anything about how exactly you send this simple call
-
Pascal123
hi sech
-
sech1
what software you use? What is the command line you use? Your OS? Where is the monerod running, locally or not?
-
sech1
monerod command line?
-
sech1
firewall settings?
-
sech1
curl
127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json'
-
Pascal123
no i send it from code with tcpclient
-
sech1
this one 100% works if you run it on the same PC as monerod
-
Pascal123
yes , i run it on same machine
-
sech1
tcpclient? What is it?
-
Pascal123
.net c#
-
Pascal123
its a socket client
-
sech1
what programming language? Do you know it should be an HTTP request with this json?
-
Pascal123
no,i did not know
-
Pascal123
ok, then this is the issue
-
sech1
-
Pascal123
thank you very much
-
sech1
curl does HTTP requests
-
Pascal123
i did not know, sech. thank you
-
sech1
I don't know much about C#, but it should have some standard way to send HTTP POST requests
-
Pascal123
yes
-
Pascal123
hmm. which type of method does curl use ? post or get , i tried both, everytime is the response empty, or i get 404 error
-
sech1
HTTP POST
-
sech1
"-d" in curl command line makes it a POST request
-
Pascal123
ok thx
-
Pascal123
even with httppost i get 404
-
Pascal123
the daemon binds 127.0.0.1:18081,but i m not able to find it
-
sech1
do you set URL = "/json_rpc" ?
-
Pascal123
nooo, really i have to ?
-
Pascal123
hmm, fck
-
Pascal123
i willtry
-
Pascal123
brb
-
Pascal123
same Problem 404..Id = 3, Status = RanToCompletion, Method = "{null}", Result = "StatusCode: 404
-
sech1
404 means you use wrong url
-
sech1
HTTP url must be "/json_rpc" in your request
-
sech1
just use wireshark and compare what curl sends and what you send
-
Pascal123
ok
-
Pascal123
ttp://127.0.0.1:18081/json_rpc
-
Pascal123
i use that
-
Pascal123
http
-
Pascal123
....
-
Pascal123
-
sech1
url is "/json_rpc"
-
sech1
you connect to 127.0.0.1, port 18081
-
sech1
and then provide url "/json_rpc" and HTTP POST data will be the actual json request
-
sech1
okay, I see C# HttpClient needs fully qualified url
-
sech1
-
sech1
-
Pascal123
thank you sech
-
Pascal123
interesting
-
Pascal123
even curl is unable to reach daemon :
pastebin.com/6X2hn9DW
-
sech1
What's your monerod command line?
-
sech1
actually, you did get a response from monerod
-
sech1
"message": "Parse error"
-
sech1
you're running on Windows, right?
-
Pascal123
curl
127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":912345}}' -H 'Content-Type: application/json'
-
Pascal123
yes
-
sech1
curl
127.0.0.1:18081/json_rpc -d "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_block_header_by_height\",\"params\":{\"height\":912345}}" -H "Content-Type: application/json"
-
sech1
this is for Windows
-
Pascal123
ohhh ok
-
Pascal123
you are right
-
Pascal123
daemon replies
-
Pascal123
with curl
-
Pascal123
hmm
-
Pascal123
sech
-
Pascal123
my code is working now, httcclient just sucks
-
Pascal123
i m using now webclient and it works like a charm..Thank you !
-
Pascal123
till next time :)
-
Pascal123
hey
-
Pascal123
i m studying monero daemon rpc documentation
-
Pascal123
What is the pow hash please ? Is that the hash you have to run through randomx function ?
-
Pascal123
And where is the merkle tree? is it possible to to request merkle tree from daemon ?
-
rbrunner
Pascal123: You work with C#, right? Depending on what you want to do it would be much easier to use this library instead of firing off requests yourself:
moneroecosystem.org/monero-csharp
-
Pascal123
hi rbrunner
-
Pascal123
oh ok, i did not know this exists
-
Pascal123
i would like to get the computed merkle tree from a block, is that possible ?
-
rbrunner
Not sure, maybe that's not available over the RPC interface, and you would have to read blocks yourself, in the style of a block explorer ...
-
Pascal123
im interested in writing a tiny pool software in c#
-
rbrunner
You sure you need that?
-
rbrunner
Ah, ok, then maybe, yes
-
Pascal123
education purposes
-
rbrunner
Yeah. Will certainly be interesting, but maybe quite a "steep learning curve". Maybe you have to look at existing pool software, in other languages
-
Pascal123
but i dont know how to get the merkle root of a block..i dont want to port existing c++ code
-
rbrunner
I guess much is not properly documented because so damn few people write pool software :)
-
Pascal123
hmm okey...
-
Pascal123
i would like to be able to generate mining blob manually
-
sech1
there is not much documentation on it, apart from wikipedia/bitcoinwiki pages and the code itself
-
Pascal123
but isnt the monero merkle different than the merkle tree of bitcoin?
-
sech1
it uses different base hashing function
-
Pascal123
but the structure is the same ?
-
sech1
yes
-
Pascal123
bitcoin uses sha256 and monero keccak, right ?
-
Pascal123
why monero use keccak ?
-
sech1
because it's more modern and secure than SHA-256
-
Pascal123
ah ok
-
sech1
keccak is basically SHA-3
-
sech1
-
Pascal123
well, i will try to implement it...thank you
-
Pascal123
could i use sha3,too ? is the result the same ?
-
sech1
No, parameters are a bit different
-
sech1
Monero uses earlier version with different parameters because it came out in 2014, and SHA-3 was finalized later
-
Pascal123
hmm ok
-
selsta
.merge+ 8903 8904 8905 8908
-
xmr-pr
Added
-
Pascal123
One initial hash of merkle tree is computed by coinbase.. has monero a coinbase info, too or it is different? Coinbase = Coinb1 + ExtraNonce1 + ExtraNonce2 + Coinb2;
-
Pascal123
if monero does not have a coinbase info, could i use first transaction as initialization hash ?
-
Pascal123
good night guys