Bitcoin full node and query server

June 2022

Archive of the libbitcoin Slack #general channel.

Thursday, June 9, 2022

pmienk19:35
Topic: Dev Weekly Status Time: Jun 9, 2022 01:00 PM Pacific Time (US and Canada) Join Zoom Meeting https://us05web.zoom.us/j/85232961954?pwd=ME5jenh0YWlqUFJlcXptMndxYml4QT09 Meeting ID: 852 3296 1954 Passcode: Et0zKR
evoskuil19:38
Might be a little late.
pmienk19:38
no problem

Thursday, June 16, 2022

pmienk19:30
Topic: Dev Weekly Status Time: Jun 16, 2022 01:00 PM Pacific Time (US and Canada) Join Zoom Meeting https://us05web.zoom.us/j/85232961954?pwd=ME5jenh0YWlqUFJlcXptMndxYml4QT09 Meeting ID: 852 3296 1954 Passcode: Et0zKR
evoskuil23:45
C++23 gives me a function I was just about to write :>>
pmienk23:46
23 isn't in the m4 yet
evoskuil23:46
No worries, it's a 4 line impl that requires c++20.

Friday, June 17, 2022

evoskuil00:08
C++ 20 has std::bit_cast<Integer>(const uint8*), so trivial to do no-convert endian functions safely based on casting the contigous bytes directly into the integral. byteswap isn't as great, because it bit casts to a temporary byte vector and then swaps the bytes and recasts. I was trying to avoid the allocation. This is just something that facilitates stream read/write little endianness conversions without intermediate buffering, since the bytes are read out of order.
(edited)
evoskuil00:25
But I suspect there is plenty of optimization available un the C++23 stdlib implementations, so I'll just take this simple impl and replace it later.
evoskuil06:36
Fixed iteration (at compile time) loop flattening using for consexptr(...) :)). Endian conversions no longer need an iterator.
(edited)
I was going to use type constraints for each integral size type, but that's a lot of extra code because the full set of operations needs to repeated in each, and the function declarations. Compiles to the same though.
I also found the Windows intrinsics for byte swapping, and code to do it in x86/x64 assembler, just like the hashing but much much simpler.
And I was easily able to define constexpr values to determine the endianness of the platform. These can be used in template type constraints of if constexpr(...)`
constexpr auto is_native_big_endian =
to_bool(std::bit_cast<std::array<uint8_t, sizeof(size_t)>>(one).back());

constexpr auto is_native_little_endian =
to_bool(std::bit_cast<std::array<uint8_t, sizeof(size_t)>>(one).front());
Simple constexpr bool that works on any platform. Love the "new" language features.
(edited)
jungly13:36
Hey @evoskuil - pulled the latest master from your repo, and noticed those build errors on github actions too. Are you working towards moving up from C++11?
evoskuil16:15
We've moved to c++ 20, just catching CI up to it.
You should check out the interpreter. Variant stack :).
3 replies · jungly, evoskuil · last Jun 30, 2022
jungly04:16
This is so sweet! I wrote a stack and interpreted in lisp recently (why not? :)). Being dynamically typed and all, it was kind of a fun project. This variant thing is cool. I hadn't read about it before this. Thanks for pointing it out.
evoskuil07:26
C++ now has std::variant, built on a c++ union. Visitor pattern that invokes strongly typed handlers.
(edited)
evoskuil07:27
It's soooo cool how it worked out. You should give it a look. /machine
jungly17:30
Saw that commit. Soooo excited you moved to 20!
Am using coroutines for the braidpool stuff. So much nicer than chain of handlers!
evoskuil22:16
I'll take a look at it for network. I want to stick to the strand threading model, but if I can use coroutines to simplify the handing at no additional cost that would be nice.

Thursday, June 23, 2022

evoskuil19:32
Can we do 1:30 today?
pmienk19:34
Sure
pmienk20:01
Topic: Dev Weekly Status Time: Jun 23, 2022 01:30 PM Pacific Time (US and Canada) Join Zoom Meeting https://us05web.zoom.us/j/85232961954?pwd=ME5jenh0YWlqUFJlcXptMndxYml4QT09 Meeting ID: 852 3296 1954 Passcode: Et0zKR
(edited)

Thursday, June 30, 2022

pmienk19:30
Topic: Dev Weekly Status Time: Jun 30, 2022 01:00 PM Pacific Time (US and Canada) Join Zoom Meeting https://us05web.zoom.us/j/85232961954?pwd=ME5jenh0YWlqUFJlcXptMndxYml4QT09 Meeting ID: 852 3296 1954 Passcode: Et0zKR