Skip to content

Conversation

@ptschip
Copy link
Collaborator

@ptschip ptschip commented Feb 6, 2016

Here's the latest ported to v12. All working and tested.

@gandrewstone I cleaned up the thinblocks.h a bit but the classes should in future be using a template. I believe since @YarkoL is going to be working on extending xthinblocks to 32bit, 40bit etc...hashes he'll need to refactor and use a template for that anyway. For me to do it now just for the sake of one small subclass seems a bit much work and then re-testing effort on top of it.

@gandrewstone I moved some functions and declarations to unlimited.cpp. I've done the easy stuff but am having difficulty with some of them claiming that CNode is not declared but as far as I can tell it is...I'm sure I'm doing something wrong that is so simple just I can't see it. I tried with HandleBlockMessage and SendSeededBloomFilter but It seems to be a bit of a hair pulling exercise and I'm going around in circles.

@ptschip ptschip force-pushed the xthinblocks_12.0 branch 3 times, most recently from 206f8ef to 4bf5e5a Compare February 8, 2016 00:14
@ptschip
Copy link
Collaborator Author

ptschip commented Feb 8, 2016

@gandrewstone Ok, I was able to get the SendSeededBloomFilter and HandleBlockMessage out and put into unlimited.cpp.

@ptschip
Copy link
Collaborator Author

ptschip commented Feb 8, 2016

@gandrewstone I've taken out all the functions and also made comments in the code referring to BU. I'm wondering though whether for the code that doesn't lend itself well to being put into functions if we should rather put in comments around the code such as //BU: Xtreme thinblocks - begin section and then // BU: Xtreme thinblocks - end section. So that on the next release we can just grep through the files looking for those BU sections?

@ptschip ptschip force-pushed the xthinblocks_12.0 branch 2 times, most recently from 285f908 to 3d86b0e Compare February 9, 2016 00:02
@ptschip ptschip changed the title Xtreme Thinblocks Xtreme Thinblocks v12.0 Feb 9, 2016
@ptschip ptschip force-pushed the xthinblocks_12.0 branch 10 times, most recently from 0a34f51 to 01132ca Compare February 10, 2016 18:48
@ptschip
Copy link
Collaborator Author

ptschip commented Feb 10, 2016

@gandrewstone

I think this is pretty much done...can you take another look.

The only areas I really couldn't take out were starting at line 4588 and 5938 of main.cpp as there is some sort of compiler issue, something to do with the way they coded MarkBlockAsInFlight().

Areas I left in I surrounded with //BUIP010 begin and end sections.

Also, I left in the four new message type in main.cpp since there should never be a merge conflict with those.

Let me know what you think...

@ptschip ptschip force-pushed the xthinblocks_12.0 branch 6 times, most recently from 0ca8b7b to 8950f57 Compare February 12, 2016 18:48
@ptschip
Copy link
Collaborator Author

ptschip commented Feb 12, 2016

Made an update to HaveThinBlockNodeConnections. There was a bug there that could cause nodes to form a kind of deadlock where no new blocks could get downloaded if they were cross connected using "connect-thinblock=ip" and when they had no other thinblock node connections. Now it doesn't matter how many or few connect-thinblock connections, either in/outbound there are. Also, it speeds up that part of the code because we don't have to repeatedly call "findnode" which then repeatedly locks/unlocks vNodes.

@ptschip ptschip force-pushed the xthinblocks_12.0 branch 2 times, most recently from 6e39771 to 2c9e2c6 Compare February 14, 2016 01:15
Sends a seeded bloom filter along with a getdata
and receives an xthinblock transaction in return which
includes all missing transactions and tx hashes.
Once received the block is reconstructed.

Additional bandwidth is saved by using a 64 bit
Tx hash instead of all 256 bits.  Hash collisions
in the memory pool will be extremely rare however
if one should happen then a regular thinblock will
be re-requested.

Transactions still missing will be re-requested and
retrieved from a block rather than the mempool. They
will be sent back in one thinblocktx object.

Originally Inspired by Mike Hearn
xthinblock + coinbase  (dagurval)
@sickpig
Copy link
Collaborator

sickpig commented Feb 15, 2016

Hi Peter I've just built xthinkblock_0.12 branch and I got those warnings (ubuntu 14.04 64bit, gcc 4.8.4) :

main.cpp: In function ‘bool ProcessMessage(CNode*, std::string, CDataStream&, int64_t)’:
main.cpp:4460:18: warning: the address of ‘bool IsThinBlocksEnabled()’ will always evaluate as ‘true’ [-Waddress]
if (!IsThinBlocksEnabled)
^
main.cpp:4536:32: warning: the address of ‘bool IsThinBlocksEnabled()’ will always evaluate as ‘true’ [-Waddress]
if (IsThinBlocksEnabled)
^
main.cpp:4977:25: warning: the address of ‘bool IsThinBlocksEnabled()’ will always evaluate as ‘true’ [-Waddress]
} else if (!IsThinBlocksEnabled) {

CXX libbitcoin_server_a-net.o
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
CXX libbitcoin_server_a-noui.o

db/memtable.cc: In member function ‘void leveldb::MemTable::Add(leveldb::SequenceNumber, leveldb::ValueType, const leveldb::Slice&, const leveldb::Slice&)’:
db/memtable.cc:104:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
assert((p + val_size) - buf == encoded_len);
^

util/bloom.cc: In member function ‘virtual void leveldb::{anonymous}::BloomFilterPolicy::CreateFilter(const leveldb::Slice_, int, std::string_) const’:
util/bloom.cc:50:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t i = 0; i < n; i++) {
^

util/logging.cc: In function ‘bool leveldb::ConsumeDecimalNumber(leveldb::Slice_, uint64_t_)’:
util/logging.cc:58:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare](v == kMaxUint64/10 && delta > kMaxUint64%10)) {
^

@ptschip
Copy link
Collaborator Author

ptschip commented Feb 17, 2016

closing as not needed.

@ptschip ptschip closed this Feb 17, 2016
@ptschip ptschip deleted the xthinblocks_12.0 branch March 7, 2016 15:52
AllanDoensen pushed a commit to AllanDoensen/BitcoinUnlimited that referenced this pull request Jun 5, 2017
bitcoin-tx: Decouple max-tx-size from max-block-size
sickpig pushed a commit to sickpig/BitcoinUnlimited that referenced this pull request Oct 24, 2017
…n-msg

Temporarily disabled pushing xthin msges in front of the send queue.
sickpig pushed a commit to sickpig/BitcoinUnlimited that referenced this pull request Jan 29, 2019
51d3ab34ba Merge BitcoinUnlimited#10: Add pushKV(key, boolean) function (replaces #5)
129bad96d5 [tests] test pushKV for boolean values
b3c44c947f Pushing boolean value to univalue correctly

git-subtree-dir: src/univalue
git-subtree-split: 51d3ab34ba2857f0d03dc07250cb4a2b5e712e67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants