Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitcoin 0.10 has been released - what should we do? #286

Open
zathras-crypto opened this issue Feb 17, 2015 · 78 comments
Open

Bitcoin 0.10 has been released - what should we do? #286

zathras-crypto opened this issue Feb 17, 2015 · 78 comments

Comments

@zathras-crypto
Copy link

Hi all,

I'd like to get a discussion going with as much participation as possible. The issue is simply that Bitcoin 0.10 has been released, and this is not compatible with OmniCore 0.0.9.1 (due to headers first).

We're gearing up to release the UI, however we need a strategy to handle the issue. We can't have our first major end user release being a failure because we haven't planned for this appropriately.

Thoughts please?

Thanks
Z

@achamely
Copy link

How does the Omnicore process the omni transactions now. Are they triggered during the normal bitcoin tx processing? If so how about adding a middle man step.

High level thought process:
The new headers first method seems to grab multiple chains and determines which one has the most proof-of-work before downloading its actual blocks. Could we, Once the download blocks is triggered, side process and create a standalone list of Omni tx's with corresponding tx/block times. Then once the blockchain data is complete we trigger the full omni parsing of our new ordered list.

@dexX7
Copy link

dexX7 commented Feb 17, 2015

Every time a new block is connected, it is forwarded to the meta layer at the moment.

For 0.10 instead of forwarding every new block, a block should be forwarded, when it's the very next to the last processed one, and the forwarding should continue, until no next block is available. But there are also "higher level" signals to subscribe to and it's not necessarily required to hook add handlers into ConnectTip (IIRC).

#263 worked, back in December, although I tested it basically only fully synchronized with new blocks added to the top.

The biggest hurdle is probably UI related, because it has changed significantly:

0 10

@msgilligan
Copy link

From my perspective (someone developing software to the RPC API) the 0.10.0 release is very desirable. Several of the improvements (faster blockchain downloading, RPC "warm-up" mode) address pain points that come up in testing/integrating.

There is also a fix for building on OS X 10.9.

And I almost certainly will update Bitcoin-Qt on my Mac.

@zathras-crypto
Copy link
Author

Sorry, for clarification I mean strategically.

So yes absolutely we want to move to 0.10, but that will take time (an unknown quantity at this point).

Moreso things like:

  • "What do we tell end users who want to use OmniCore but are already on Bitcoin 0.10?"
  • "Do we wait to release the UI, or release based on the 0.9 bitcoin code?"
  • "Is there any actual risk to end user funds/walletfiles from trying to use the wrong blockchain?"
  • "Are there any 'frustrations' for end users from trying to use the wrong blockchain? (like it being downloaded from scratch, or having to reindex again and so on)
  • "Etc etc"

The technical stuff is still important, but moreso end user facing issues such as:

  • "What happens when a user with Bitcoin 0.10 and a v0.10 blockchain runs OmniCore 0.0.9.1?"
  • "What happens when a user with OmniCore 0.0.9.1 and a v0.9 blockchain runs Bitcoin 0.10?"
  • "Do locks still effectively prevent both being run together?"
  • "Etc etc"

The actual questions surrounding a technical migration would be addressed as we actually worked towards OmniCore 0.0.10. I'm moreso concerned with the here and now - our ability to a) deliver this platform in a working fashion if we release now and b) our ability to support the platform in the context of the incompatibilities between the 9 and 10 branches of Bitcoin.

Hope that makes more sense :)

@msgilligan
Copy link

I guess I'm saying I support switching to 0.10.0 before making any new releases -- including the UI. At the very least we should take the time to quantify the effort before deciding.

@zathras-crypto
Copy link
Author

So the decision was made to go ahead with a 0.0.9.1 based release, along with some code to force a shutdown during startup if we detect a blockchain from 0.10.

First question now to all - before I spin up the VM's to test, has anyone actually tried to run OmniCore 0.0.9 against a 0.10 blockchain? @msgilligan you mentioned you thought code was already there to prevent 0.9 bitcoin clients running when a 0.10 blockchain is present - have you tested this by any chance?

Thanks all
Z

@msgilligan
Copy link

I haven't tried it, no. I don't have any specific knowledge, just a hunch given what I know of the Bitcoin core team and the fact that this feature was on their roadmap for a long time.

The Downgrading section of the 0.10.0 release notes says "It is possible that the data from a completely synchronised 0.10 node may be usable in older versions as-is, but this is not supported and may break as soon as the older version attempts to reindex."

@zathras-crypto
Copy link
Author

OK great, thanks for the info - that's kind of what I was concerned about - have a bitcoin 0.10 install and run Omnicore which may "break as soon as the older version attempts to reindex" - that kind of indicates to me that an older version will attempt to reindex, rather than cleanly shutting down.

I'll have a poke around and see what I can come up with :)

Thanks
Z

@dexX7
Copy link

dexX7 commented Feb 17, 2015

Just playing devil's advocat here for the sake of being overly protective: the risk is that blocks are stored out of order, because they arrive out of order, and an old client may not make sense of it. I assume that this risk is also given, if the user is just a few blocks behind and catches up.

Blocks will be stored on disk out of order (in the order they are received, really), which makes it incompatible with some tools or other programs. Reindexing using earlier versions will also not work anymore as a result of this.

Reindexing and fetching the last blocks doesn't seem much different.

Edit: this was only a guess, but after thinking more about it: blocks are indexed, and a 0.9 client wouldn't necessarily locate blocks by scanning files, but rather looking into the blockdb, so the statement regarding reindexing gains more significance for me now and it is also a bit different than catching up.

@zathras-crypto: do you have an idea how to identify it?

@zathras-crypto
Copy link
Author

Alrighty, testing this out myself ATM. Have taken a snapshot, deployed 0.10 and spun it up. Firstly no idea why it needed to write over a GB of delta when 'verifying blocks' - assuming it's doing more than just verification there.

It still appears to be syncing in sequence (days going down one by one, blocks processed going up sequentially about 50 blocks at per update).

@zathras-crypto
Copy link
Author

OK. I performed the following test:

  • Take a bitcoin core instance that's about 5 days behind
  • Upgrade it to bitcoin 0.10
  • Start it up, let it sync
  • Run OmniCore 0.0.9.1

First thing to confirm, there is absolutely no detection or protection against using the bitcoin 0.10 blockchain with an earlier client (at least bitcoin 0.9.3 (our base) anyway). OmniCore fires up no errors or warnings.

@zathras-crypto
Copy link
Author

Still nosing around looking for a way to detect if 0.10 has been used on the blockchain, but I did notice that even on 0.10 the blocks seemed to be processed in sequential order. Perhaps this is because peers aren't running 0.10?

http://pastebin.com/raw.php?i=2hRmGrp5

@dexX7
Copy link

dexX7 commented Feb 18, 2015

You should try getblockchaininfo, but it looks like you're already fully synced now. It shows the number of headers as well blocks.

@dexX7
Copy link

dexX7 commented Feb 18, 2015

So the decision was made to go ahead with a 0.0.9.1 based release, ...

Not that I want to hijack this decision, but I was curious about the block connection behavior and ended up porting Omni Core without UI to Bitcoin Core 0.10 in the last hours.

All regtests passed and at the moment I'm synchronizing on mainnet and dump every handler call. Looks good so far! And it appears that ConnectTip is triggered, once there is really a new, next, block:

omni_tips

I'm away for a few hours now, but I'll try to push everything wrapped into expressive commits later.

That being said, porting was so much easier than assumed, but only because I prepared most of it earlier, e.g. cleaning up the includes etc., ... :)

But key was also to start with 0.10 and add the components one by one, instead the other way around as last time, which came with like 100 merge conflicts. >_<

As heads up, those are requirements:

... and my current build also includes some of the other PRs, right now to ensure it also passes the other tests I have.

The incompatibility issues can be resolved in ~15-30 lines or so in total, so reviewing the PRs is probably most of the work for Omni Core based on Bitcoin Core 0.10 without UI modifications, but plain Bitcoin Core interface. Edit: to clarfiy: graphical interface. All the RPC interaction work fine.

@zathras-crypto: what do you think about porting the QT code? As very rough guess I'd assume the tricky part is to deal with 0.10's new interface, while the code blocks could probably be copied one to one. Will take a look at this later as well, if I find some time..

@zathras-crypto
Copy link
Author

But key was also to start with 0.10 and add the components one by one, instead the other way around as last time, which came with like 100 merge conflicts. >_<

Hehe, that's also Michael's preferred methodology :)

All regtests passed

I think the primary issue is that I don't think anyone is comfortable changing our underlying bitcoin version in a minor release. It's GREAT to know this can be progressed in such a straight forward manner, and well done my friend :) but when looking at a risk angle - to play the safe card we need to change our base Bitcoin code in a major release not minor.

To be frank, the issue is driven by timing primarily. The powers that be want the UI released yesterday and putting whatever QT work is required aside for a moment, I would still insist on a whole bunch of testing for a new base bitcoin version. I really do appreciate the testing you've done so far, but for me I just don't feel comfortable enough yet to say "in 100% of potential circumstances there is absolutely no possible change to Omni data in bitcoin 0.10" which is needed to do a non-major release.

Sorry, not wanting to ramble on - long story short the main driver is to do 3 things:

  1. Clean up the last criticals - signalling - potentially via your PR. Apologies for the delay there (sadly I'm in and out of hospital for various tests at the mo which is quite a time drain, but health has to come first)
  2. Put in detection for a 0.10 blockchain and refuse to start (safety net)
  3. Release the UI as 0.0.9.1

Once that's done, we could even skip 0.0.9.2 and move straight to a 0.0.10 with bitcoin 0.10.

what do you think about porting the QT code?

To be honest I don't think it'll be a major drama, I'll be applying similar logic to you & Michael with the copying files over - though there may need to be some time spent in QT designer adjusting some of the forms (that's always fun! /sarcasm)

@zathras-crypto
Copy link
Author

I'm honestly having quite a hard time trying to find a way to detect a 0.10 from the blocks or chainstate programatically.

So far I can quite easily identify it by checking if the debug.log has certain elements that were introduced with 0.10, but that does not feel like a safe or solid way to do it.

Any suggestions welcome :)

Thanks
Z

@dexX7
Copy link

dexX7 commented Feb 19, 2015

I'm in and out of hospital for various tests at the mo which is quite a time drain ...

Oh damn, I hope you're well!

I think the primary issue is that I don't think anyone is comfortable changing our underlying bitcoin version in a minor release.

Please don't get this wrong, but given that there was not a single announcement on either one of the mailing lists, the forums or the blog about the last consensus critical release, I'm wondering: which release process?

The regtests are by far not complete and relying on them only would be crazy at this point, though it's unfortunally the only route of testing, besides consensus checks, that is currently available. One reason I'd value increasted testing is to replace "feeling it may or may not work" by "knowing this or that definitely works, confirmed by tests". A sort of long way still.

As mentioned earlier, I fully support the conservative approach, but I'm happy about the realization it worked out better than expected. :) But I also agree that pushing the UI release should be highest priority!

Hehe, that's also Michael's preferred methodology :)

Actually this is should only be a workaround and not providing the full commit history is a no-go in my opinion, but it should be possible to cheat here: 1) get the desired result, 2) merge from scratch to preserve history, 3) see tons of conflicts, 4) replace files with desired result from earlier, 5) commit.


Back to the actual issue:

It would certainly help to know what risk there might be, to shutdown as consequence, if things go south. I assume your 0.10 datadir is synced now? If so, and if you don't mind, I'd be very curious about what would happen, if it's used in combination of reindexing and Omni Core 0.0.9.1.

The two relevant questions in this context:

  • Could running Omni Core 0.0.9.1 do any harm to existing 0.10 data?
  • If something goes wrong, e.g. the next block can't be found due to the out of order storage, could it affect the meta layer or would it crash/fail earlier?

I'm not really sure how the reorg handling and persistence layer of Omni Core comes into play here, but it's guaranteed that no new transaction reaches the meta transaction processing, if the block it belongs to isn't the a very next to the earlier one.

See the assertion at the beginning:
mscore-0.0.9/src/main.cpp#L2022-L2024:

// Connect a new block to chainActive.
bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew) {
    assert(pindexNew->pprev == chainActive.Tip());  //<! THIS ONE HERE

    (void) mastercore_handler_block_begin(GetHeight(), pindexNew);

A few lines later is the actual transaction handler call, which won't be reached by out of order blocks:
mscore-0.0.9/src/main.cpp#L2068-L2073:

    BOOST_FOREACH(const CTransaction &tx, block.vtx) {
        SyncWithWallets(tx.GetHash(), tx, &block);
        if (0 == mastercore_handler_tx(tx, GetHeight(), tx_idx++, pindexNew )) ++countMP;
    }

    (void) mastercore_handler_block_end(GetHeight(), pindexNew, countMP);

@zathras-crypto
Copy link
Author

Oh damn, I hope you're well!

Thanks dude :) Just got results for CT - taking a glass half full attitude - still don't know what's wrong but given what the Doc suspected I actually shed a tear (call me a p*ssy if you will hehe) when I rec'd the all-clear for that particular diagnosis this morning - sadly more tests now to figure it out but it's pretty darn relieving when the Doc suspects bad things and the tests come back clear :)
image

Please don't get this wrong, but given that there was not a single announcement on either one of the mailing lists, the forums or the blog about the last consensus critical release, I'm wondering: which release process?

If there was a way to +1 that comment enough that people would take notice, I would! Honestly mate, I've been raising the issue of a lack of process for release for some time now it just doesn't seem to get much traction :( though I honestly consider it one of the most important pieces to a successful progression on this project.

Back to the actual issue:

Yeah agreed - trying to play the conservative approach but it's really not that easy to identify whether blocks have been written out of order. I do have a methodology but it's loooooooooong-winded and I don't want to use it (it involves looping CBlockIndex for each block and looking up the blk???.dat file it's stored in along with it's byte position and undo locations in the rev???.dat files and then ensuring they're sequential from the previous block). Also scraping debug.log works but isn't what I'd call solid (eg what happens if user deletes that file). I was actually surprised as I thought there would at least be some change to CBlockFileInfo regarding the new way of doing things but it seems not sadly.

Could running Omni Core 0.0.9.1 do any harm to existing 0.10 data?

I don't believe it would, but then that's not backed up by anything other than assumption on how certain things work.

If something goes wrong, e.g. the next block can't be found due to the out of order storage, could it affect the meta layer or would it crash/fail earlier?

Well I was actually chatting with @m21 about that this morning, he made a suggestion of keeping our own eye on things in our own handlers so we could thus make sure to abort the node if for some reason the block handler was called on an out of order block. I don't think it solves the issue because the issue is more one of older clients being able to get at out of order blocks rather than processing out of order (as you note, connecttip should always be called sequentially otherwise core would be processing bitcoin transactions for which the inputs didn't exist yet) but I still think it would be a nice sanity check to drop in given the ease of doing so.

I continue to believe the path of least resistance is to block 0.10 users from using OmniCore 0.0.9.1 and get it released, and then just put all our effort into a OmniCore 0.0.10 branch that uses the new bitcoin 0.10 base and do the requisite analysis and testing while we're not being pressured to release. Just getting there seems to be more of a PITA than I first thought hehe.

Thanks
Z

@zathras-crypto
Copy link
Author

Figured I'd commit what I'm working on at the mo so you can take a look mate - basically now I'm avoiding loading the blocks from disk and purely using the index it's a lot faster - would still like a better way to do it but this is what I'm poking around with and testing out atm zathras-crypto@325a3b9

Thanks
Z

@zathras-crypto
Copy link
Author

FYI:
image

@msgilligan
Copy link

A few 0.10.0 goodies related to RegTest mode that I just discovered:

bitcoin#5275 (RegTest performance improvements)
bitcoin#5280 (setmocktime timestamp RPC, could be useful for crowdsale testing, etc.)

@dexX7
Copy link

dexX7 commented Feb 20, 2015

Ah, great progress!

First off, again, @zathras-crypto: hope you're well!

I tested this approach and it works! Neat idea of checking it this way and I can confirm out of order storage of my 0.10 files. I'm very curious what happens, if I resync 0.9 now .... hehe.

Just wondering about all the vectors and maps? Check this out:

https://gist.github.com/dexX7/807cb7a0e26383d616d0
https://gist.github.com/dexX7/b8b47abaddf3619c3432

While thinking about this, and I really have no idea if it's feasible: would it be possible to copy the reindex logic of 0.10 to support out of order storage, if it turns out this is the primary issue?

@msgilligan: Yeah, the block generation is notably faster. :)
Ah and as a side note: the local consensus checks worked fine for me.

@dexX7
Copy link

dexX7 commented Feb 20, 2015

Using 0.9 as it is works well, even when reparsing all Omni transactions, but reindexing with 0.9 causes a segfault.

@zathras-crypto
Copy link
Author

First off, again, @zathras-crypto: hope you're well!

Thanks mate :)

Just wondering about all the vectors and maps? Check this out:

Both of those gists look like interesting methods to simplify what I have mate, nice - let me take a poke around them :)

FYI that code is a reimplementation of PrintBlockTree which is where the maps/vectors come from - probably not necessary (hadn't optimized at all, only got as far as getting something that 'works'). I had the idea on the 'how', and wrote my own code for it but it was slooooow as anything because I was loading each block from disk to analyze. So I went hunting for a method I could use to just do it via the blockindex. Some grepping later I found that the bitcoin devs had the PrintBlockTree function which looked like it would serve as an excellent starting point for this, so I cloned the function and modified it to do what we wanted.

While thinking about this, and I really have no idea if it's feasible: would it be possible to copy the reindex logic of 0.10 to support out of order storage, if it turns out this is the primary issue?

How would you rate the value of this? In my head I had a kind of "get 0.0.9.1 out and then shift all our resources into a 0.10 based branch", so I hadn't really envisioned putting too many more resources behind a 0.9 based branch after 0.0.9.1.

Using 0.9 as it is works well, even when reparsing all Omni transactions, but reindexing with 0.9 causes a segfault.

That's quite interesting actually. So an end user may get away with it (if we didn't have the abort in place) as long as they already had a txindex, but a user who uses a fresh bitcoin 0.10 and then fires up Omni (which enables txindex and thus needs a reindex) would see a segfault?

@dexX7
Copy link

dexX7 commented Feb 20, 2015

Impressive. The following commit works out of the box with 0.9 and resolves the reindex issue. Maybe it's too early to say, but I feel very confident that this can be used for 0.0.9.1 to handle out of order blocks and Bitcoin Core 0.10 files: bitcoin@ad96e7c

Edit: and the log entries confirm:

UpdateTip: new best=00000000000133c15396bdc0deada3b92e1853cf4758aeb2164bd43a382c723c  height=103358  log2_work=59.250183  tx=236822  date=2011-01-18 20:39:45 progress=0.001802
ProcessBlock: ACCEPTED
LoadExternalBlockFile: Out of order block 00000000000262da964b17196f4a7408c8a2f012d3ac4f41992cfa97b67b4516, parent 000000000000a93b9824a7c979a5d04a9bb23d320f92999d1fada4758e84f716 not known
LoadExternalBlockFile: Out of order block 0000000000005c338692caf0258e42d6388057422622cb03371d534048db7814, parent 000000000002b73753cffd2684a870427988075d6b23a5c75d7b94d70a0b265c not known
LoadExternalBlockFile: Out of order block 000000000002ec3b6e04134c93c55e0310367a402b9fde62b0fdaa23a2012c04, parent 0000000000018a17b2d6a6874492aaac0363875c3b9f69b95bdc4cf73493b0ce not known
LoadExternalBlockFile: Out of order block 0000000000018fa3de766361a49c5f532ce526a4685ae59ddc4e8ac2f9a49531, parent 0000000000010d98058c41320451bb56d5814e240884fb7f8f5a19155a9b1c0c not known
LoadExternalBlockFile: Out of order block 00000000000219064a40eb11dbf8c26d07525a85cf55eaa7a96d74e496a0983c, parent 0000000000015e968f5536142bf7ab1aca037e4f3f551d173bcd9b65f98ea4fe not known
LoadExternalBlockFile: Out of order block 000000000000706a27683dc58eb601c1fdd75e8ebb87fecd005e96de9cb6d4ca, parent 00000000000055c5040a4ef0e3ae5bf8bcdd2ac4587d7088924a411b4fa1a13b not known
LoadExternalBlockFile: Out of order block 000000000000e8731e88ec9cc75815cc13b3eed6971c14e34cb64b2c4f5aa120, parent 000000000002206de2adbb58eabed28c6e92ea1c2d79fe51cde060564d24cfba not known
UpdateTip: new best=00000000000028bfe108436f40a8ead0482fff32e7b3ac76a0c37c24cf7952cf  height=103359  log2_work=59.25035  tx=236825  date=2011-01-18 20:51:20 progress=0.001802
ProcessBlock: ACCEPTED
LoadExternalBlockFile: Processing out of order child 000000000000f64bcec2e37569f83b920df870fbacad7dbf9bf4a95ed6ad31a1 of 00000000000028bfe108436f40a8ead0482fff32e7b3ac76a0c37c24cf7952cf
UpdateTip: new best=000000000000f64bcec2e37569f83b920df870fbacad7dbf9bf4a95ed6ad31a1  height=103360  log2_work=59.250516  tx=236826  date=2011-01-18 20:55:40 progress=0.001802
ProcessBlock: ACCEPTED
LoadExternalBlockFile: Processing out of order child 00000000000241e2433a0ac6dd3b55cc90937eb65078e090e6bf79f3baed5aaa of 000000000000f64bcec2e37569f83b920df870fbacad7dbf9bf4a95ed6ad31a1
UpdateTip: new best=00000000000241e2433a0ac6dd3b55cc90937eb65078e090e6bf79f3baed5aaa  height=103361  log2_work=59.250683  tx=236846  date=2011-01-18 21:07:16 progress=0.001802

@dexX7
Copy link

dexX7 commented Feb 20, 2015

I'm going to fully resync reindex now and check the final results. If this is turns out to be successful, I suggest to adopt the reindexing code, but fire a warning nevertheless, if a 0.10 chain is detected during the start.

This is less restrictive than forcing a shutdown, and - based on the assumption that the actual risk is related to reindexing - it should be safe, even if the warning is ignored.

As final test, it would be very good to know, if synchronizing (not reindexing) from scratch works as well with this commit.

There seem to be five user groups who may use Omni Core:

  • 0.0.9.1 users starting from scratch (unknown at this point)
  • 0.9 users switching to 0.0.9.1 without txindex (covered)
  • 0.9 users switching to 0.0.9.1 with txindex (covered)
  • 0.10 users switching to 0.0.9.1 without txindex (affected and warned!)
  • 0.10 users switching to 0.0.9.1 with txindex (covered)

The handlers are furthermore guarded against out of order blocks, so, at least regarding the state of Omni/Master, the risk potential seems low.

But I'm still not entirely sure, if there are other side-effects.

@zathras-crypto
Copy link
Author

FYI from a discussion I had with @m21 my view was essentially:

the key takeaway for me is that bitcoin devs say of 0.10 "the block files and databases are not backwards-compatible with older versions of Bitcoin Core" which says to me we do not want to use 0.9.3 omnicore against 0.10 blockchain

That's me being risk-averse (probably my background in infra mgmt :P). However when considered in the context of:

It is possible that the data from a completely synchronised 0.10 node may be usable in older versions as-is, but this is not supported and may break as soon as the older version attempts to reindex.

So I guess it comes down to the question of if the bitcoin devs don't want to support using 0.9.x clients on a 0.10 blockchain, do we? I do concur with your analysis above though and the note specifically relates to reindexing breaking, so if we fix that the risk does appear low.

EDIT "completely synchronised" - what about a node that's not completely synchronised? Ie user starts with a 0.10 node, synchronizes half of it (so has a complete set of headers completed via getheaders but only half the blocks via getdata) and then fires up 0.0.9.1

@zathras-crypto
Copy link
Author

The following commit works out of the box with 0.9 and resolves the reindex issue. Maybe it's too early to say, but I feel very confident that this can be used for 0.0.9.1 to handle out of order blocks and Bitcoin Core 0.10 files: bitcoin/bitcoin@ad96e7c

I notice that commit is based on top of the headers first PR - is it safe to cherry pick it without the underlying PR?

@dexX7
Copy link

dexX7 commented Feb 20, 2015

Yes, cherry-picking should in work, but it created conflicts for me, but only limited to the changes itself. Otherwise copy and replace by hand.

Regarding 0.9 in general: it's notable that rather sooner a softfork related to BIP 66 kicks in, see:

https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki#deployment

This doesn't make 0.9 unusable, but I tested it earlier on regtest and as result a yellow warning in the UI is shown:

Warning: This version is obsolete, upgrade required!

You may spot entries such as the following in the debug.log:

SetBestChain: 4 of last 100 blocks above version 2

@dexX7
Copy link

dexX7 commented Feb 20, 2015

Either way, I think pushing the release as soon as possible should be a goal, and as next step the migration to 0.10, which appears to be rock solid (appears.. hehe) as server build, in terms of mainnet consensus and all tests that are available.

@zathras-crypto
Copy link
Author

Well sadly GitHub process isn't my strongest suit mate, but I had discussed the process with Michael and agreed it essentially as:

  • Clone Bitcoin 0.10
  • Copy over the mastercore* files from 0.0.9.1
  • Add bits in init.cpp/main.cpp that were missing
  • This is where we have a base commit, and that base commit could be used to check mastercore files are original and that bitcoin files have not been modified (other than expected changes in init/main)
  • Then further commits to fix bits broken by Bitcoin 0.10 which can be checked individually

TL:DR; I thought you basically had it with

You have to compare the files of the first commit:
Upgrade: add Omni Core v0.0.9.1-rel files [aa07e74]
This should match with the files of 0.0.9.1-rel.
From there I added the required changes to work with Bitcoin Core 0.10:
Commit history

Basically as long as we have a way to track the history of what's been changed I'm comfortable :)

@dexX7
Copy link

dexX7 commented Mar 18, 2015

So just to clarify: the Bitcoin Core 0.10 based branch is basically ready:

That's the one you took a look at and it's last state is also the one I'd build upon.

It contains the full Bitcoin Core commit history and the commits I made, starting with the "copy mastercore*" files commit, followed by the upgrade patches.

What I intended was to restore the whole commit history of the Omni/Master Core related commits as well, which I consider as nice to have. Alternatively, I could edit the commit message of the "copy commit" and add a link to the last commit of which those files were based on. This would be doable within a few minutes, but that comes at the price of no Omni/Master Core related commit history prior this point.

As next step, one of the owners, namely @CraigSellars or @achamely, would have to copy/clone/mirror the current mastercoin-MSC/mastercore to OmniLayer/omnicore, or create the repo by some other means, so the 0.10 based branch can be pushed.

@zathras-crypto
Copy link
Author

Right right that makes much more sense, thanks for the clarification :)

@dexX7
Copy link

dexX7 commented Mar 18, 2015

Fine, so what do you suggest to do now? :)

@zathras-crypto
Copy link
Author

As next step, one of the owners, namely @CraigSellars or @achamely, would have to copy/clone/mirror the current mastercoin-MSC/mastercore to OmniLayer/omnicore

Adam, could you do the honours mate?

@zathras-crypto
Copy link
Author

In case I wasn't clear guys this is ready to go - I've checked the mastercore_* files were unchanged and the subsequent commits were clean - it's literally just waiting on the repository move @CraigSellars @achamely :)
Thanks
Z

@zathras-crypto
Copy link
Author

Just a little chase :) can we get this repo move actioned? (I'm working locally atm)

@dexX7
Copy link

dexX7 commented Mar 22, 2015

Well yeah, would be great. :) Please publish/push nevertheless. :)

@zathras-crypto
Copy link
Author

Heh, not so sure I should publish what I have right now lol it's a bit of a mess :P (I'm in the middle of redoing the UI for 0.0.10)... As a side note, how would I do that on github (when I'm ready to push)? Right now I'm working on a new branch I checked out dexx-0.0.10-ui directly under a clone of your bitcoin repo with the origin as origin/omnicore-0.0.9.2-no-history - I'm just using it as a base for the UI work but if I did want to push I'd need to I think add zathras-crypto as a remote and then push to that?

@dexX7
Copy link

dexX7 commented Mar 22, 2015

Ah I see. :)

I usually start with a new branch, based on the current tip. Let's assume upstream points to the Omni Core repo, where omnicore-0.0.10 is the main branch, which you already cloned locally.

To switch to that branch:

git checkout omnicore-0.0.10

Refresh your local copy and pull updates, if there are any:

git fetch upstream omnicore-0.0.10 << might not be necessary
git pull upstream omnicore-0.0.10

You probably already have done something similar, but with my branch. From here:

Add your remote:

git add remote public https://github.com/zathras-crypto/mastercore.git

Create a new branch:

git checkout -b ui-feature-branch

Do some work, add some commits.

And finally push:

git push public ui-feature-branch

To remove a branch locally:

git branch -D temp-branch-to-delete

public and ui-feature-branch can of course be replaced by something else.

Hope this helps. :)

@achamely
Copy link

Just catching up on this thread now. We have to options, I can either Move the existing repository from mastercoin-msc to omnilayer and rename it to omnicore
or i can clone a new instance of mastercoin-msc and rename it to omnicore. Suggestions/thoughts @zathras-crypto @CraigSellars (Info about moving a repo and impact is available here https://help.github.com/articles/transferring-a-repository/)

@zathras-crypto
Copy link
Author

My preference would be to clone rather than move :)

@zathras-crypto
Copy link
Author

@dexX7 just a quick update mate - @achamely & I spoke about this on Skype today - the decision is essentially one of move or clone - will be discussed at the meeting in the morning and then can get taken care of :)

Thanks
Z

@dexX7
Copy link

dexX7 commented Mar 24, 2015

Great to hear.

@zathras-crypto
Copy link
Author

Sean mentioned in the meeting today that it might be better to not fork from Bitcoin and just do a fresh push to the new repo from a local clone, as this helps with certain stats? Any feedback on that @dexX7?

Otherwise it'll be a new fork of Bitcoin, not a move of the old repo.

Thanks :)
Z

@achamely
Copy link

After discussing in the meeting we are going with a fresh fork of bitcoin to preserve upstream visibility and allow changes to be pulled/pushed? in future. its up on https://github.com/OmniLayer/omnicore now.

@dexX7
Copy link

dexX7 commented Mar 24, 2015

After discussing in the meeting we are going with a fresh fork of bitcoin to preserve upstream visibility and allow changes to be pulled/pushed?

Thanks. This would have been the point I'd raise as well.

@dexX7
Copy link

dexX7 commented Mar 24, 2015

@achamely: given that Bitcoin Core 0.10 works very well with Travis and the base file already exists - even though it fails with Omni Core due to the wallet and txindex requirement at the very moment - I suggest to enable Travis for OmniLayer/omnicore. PR/build notifications could be turned off at first.

@dexX7
Copy link

dexX7 commented Mar 24, 2015

Ah, and please enable "issues". :)

@achamely
Copy link

Issues enabled (as well as wikis)

@achamely
Copy link

@dexx i know @msgilligan has already got a jenkins ci environment setup. How is travis different/better?

@dexX7
Copy link

dexX7 commented Mar 24, 2015

@achamely: It's not better, but what I really miss are automated tests of pull requests.

Doing consensus tests and alike should still be done via the CI server - it's more about using what is already given, and leveraging the test infrastructure that comes with Bitcoin Core. In particular this includes testing of ARM, Linux, Windows and OS X builds with different configurations (example).

Depending on whether this is an option, I'd take a look at how the "txindex" and "with wallet only" build requirements could be addressed (during testing), which would currently result in test failures.

@msgilligan
Copy link

Jenkins supports automated tests of pull requests, but there are security and configuration issues in setting it up and I haven't had time to resolve them.

@dexX7
Copy link

dexX7 commented Mar 26, 2015

@msgilligan: sorry to be unclear, this is acutally the point: it is costly, in terms of setup time, risk exposure and additional load on the server, which is better be used for the core operation - deep testing of Omni Core.

It should probably be aimed for to provide a similar set of features and tests via the CI environment, but until then I actually see no reason not to use Travis as complementary.

OmniLayer#4 tackles the issues related to txindex and wallet requirements, which I mentioned earlier.

@msgilligan
Copy link

I think we're in agreement. Absolutely use Travis as a complementary solution. However at some point if I find an easy way to combine Docker and Jenkins -- or need to do it for another reason -- then we can revisit this.

@dexX7
Copy link

dexX7 commented Mar 26, 2015

Ah thanks @msgilligan. Ideally we would run both test suits, to ensure all builds are fine and pass the Omni Core related tests. I'm running Travis on my bitcoin/omni repo for a while and yesterday noticed it's already pretty close to the maximum build time of 50 minutes, so I guess there is no way to squeeze it in as well. If it turns out those 50 minutes are not sufficient, I even guess the number of tests would have to be reduced. Unfortunally Travis doesn't allow caching for "non container builds", but using "container builds" is currently not possible, because sudo (and thus apt-get install) is not allowed there.

@zathras-crypto can you please take a look at OmniLayer#4? (edit: merged)
@achamely: once that PR is in, these are the steps to take: #269 (comment)

@dexX7
Copy link

dexX7 commented Apr 2, 2015

@msgilligan:
Soo.. I reached out to the Travis support and asked, if it might be possible to whitelist certain repos for caching (as appearingly done for bitcoin/bitcoin), but this was basically declined. The speedup would roughly be 5-6x, and I guess it would be possible to manually cache some directories, but this is, at least for me, be not trivial to realize.

But I also played around a little with cross compiling on my Ubuntu VM, and this part was actually easier than anticipated.

In another fresh VM I then setup Jenkins and created a job with multi-configuration build matrix. Turned out this works different than expected, but I think I got it now. The key was to have only one build matrix parameter, named compiler (or whatever), with the values:

"ARM" "bitcoind" "64-bit_qt" "32-bit_dash" "Cross-Mac" "Win64" "Win32"

As far as I can see it's not very different to standard jobs, except the build matrix:

jenkins-matrix

For the actual build step, I converted the Travis configuration into a shell script:

There were a few issues so far:

  • not surprising, it was required to install git and the dependencies listed in doc/build-unix.md
  • further, the user jenkins requires sudo to fetch and install apt packages
  • building must be done sequentially, because otherwise there seem to be file locking issues
  • running the deamon of the Windows builds was sort of unsuccessful, so testing those is disabled for now
  • and last but not least, for OS X building some SDK is required (I guess that's the same one I was emailing you about earlier), which is hosted on bitcoincore.org, and I never changed it, because my Travis builds were just fine, but it looks like certain access is whitelisted and downloading the SDK from another source fails

I'm currently running this configuration and not all builds with spock tests finished, but the Windows builds (with Bitcoin Core tests) appear to work well, and the spock tests I saw so far, too. :)

What do you think about it?

Re: pull requests and status updated, which I posted earlier, but just in case:

Edit: even though I'm testing building via a build matrix, I assume it's more convenient in terms of test output handling, when using more than one job.


@achamely:
I suggest to enable Travis nevertheless, even though this can only be used for building and Bitcoin Core tests, it's an improvement, basically without any effort. :)

@msgilligan
Copy link

Hi @dexX7 I'm 100% focused on OmniJ for the next couple of days. I'd love to see cross-compiling on Jenkins, though.

@dexX7
Copy link

dexX7 commented Apr 10, 2015

@achamely @CraigSellars (as organization admins):

Please enable Travis CI for automated testing, including pull requests for OmniLayer/omnicore. While this doesn't cover the RPC tests via bitcoin-spock, it does test six different build plattforms, a huge number of Bitcoin Core tests, and of course the unit tests.

Given the increased number of unit tests currently added, this becomes more and more relevant.

It takes 5 minutes and simply consists of a GitHub authentification. See: #269 (comment)

@dexX7
Copy link

dexX7 commented Apr 15, 2015

We have now a Bitcoin Core 0.10 based branch over here:
https://github.com/OmniLayer/omnicore/tree/omnicore-0.0.10

This can be closed in my opinion.

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

No branches or pull requests

4 participants