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

Backport newer serialization facilities from Bitcoin #1535

Merged

Conversation

cyrossignol
Copy link
Member

These changes refactor the application to use the updated binary serialization system from the current version of Bitcoin. It also includes the more recent changes to prerequisite code for allocators, streams, the prevector type, and the Span type, and it replaces OpenSSL memory-zeroing with Bitcoin's library-independent implementation.

Because of the ubiquitous need for serialization utilities in much of the codebase, this alleviates some of the friction we'd encounter for future upgrades to the codebase as we backport functionality from Bitcoin. It adds big-endian support to help prepare the application for full compatibility with big-endian platforms.

@cyrossignol cyrossignol force-pushed the upgrade-serialization branch 2 times, most recently from 31ea247 to 6a6389f Compare September 24, 2019 06:12
@jamescowens jamescowens self-requested a review September 25, 2019 00:59
@jamescowens jamescowens added this to the Fern milestone Sep 25, 2019
@jamescowens
Copy link
Member

Ok. I merged the superblock validation PR, so this one now has conflicts. Super job though. Let's get this one rebased and then get it merged.

This refactors the parts of the application that depend on the secure
allocator and zero-after-free allocator. It replaces the structure to
copy Bitcoin's file hierarchy. This updates the secure allocator with
the newer memory swap prevention mechanism.
This replaces the remaining OPENSSL_cleanse() calls with Bitcoin's
memory_cleanse() function.
Bitcoin moved the stream-like classes out of serialize.h into streams.h
and added several new classes. This refactors the application to use the
new file for code that uses the existing stream objects.
Bitcoin moved its stream classes out from serialize.h into streams.h.
These changes update the application serialization and stream code to
match Bitcoin's newer implementation with the following exceptions:

- CSizeComputer retains nType for legacy code with type-dependent
  serialization (SER_NETWORK, SER_DISK, SER_GETHASH, ...)
- The retention of serialization implementations for std::tuple
  for the deprecated accounting API

The backport includes some new stream classes from Bitcoin not used in
Gridcoin. We may refactor code to use these new classes in the future.
@cyrossignol cyrossignol marked this pull request as ready for review September 25, 2019 04:56
The ProjectStats convergence hint is not part of the superblock hash, so
don't serialize the hint while hashing the superblock.
@jamescowens jamescowens merged commit caaa0f5 into gridcoin-community:development Sep 25, 2019
@cyrossignol cyrossignol deleted the upgrade-serialization branch October 17, 2019 06:51
jamescowens added a commit that referenced this pull request Oct 22, 2019
Added
 - Add testnet desktop launcher action for Linux #1516 (@caraka)
 - Shuffle vSideStakeAlloc if necessary to support sidestaking to more than 6 destinations #1532 (@jamescowens)
 - New Superblock format preparations for Fern #1526, #1542 (@jamescowens, @cyrossignol)
 - Multisigtools
   - Consolidate multisig unspent #1529 (@iFoggz)
   - Scanforunspent #1547 (@iFoggz)
   - consolidatemsunspent and scanforunspent bug fix #1561 (@iFoggz)
 - New banning misbehavior handling and Peers Tab on Debug Console #1537 (@jamescowens)
 - Reimplement getunconfirmedbalance rpc #1548 (@jamescowens)
 - Add CLI switch to display binary version #1553 (@cyrossignol)

Changed
 - Select smallest coins for contracts #1519 (@iFoggz)
 - Move some functionality from miner to SelectCoinsForStaking + Respect the coin reserve setting + Randomize UTXO order #1525 (@iFoggz)
 - For voting - if url does not contain http then add it #1531 (@iFoggz)
 - Backport newer serialization facilities from Bitcoin #1535 (@cyrossignol)
 - Refactor ThreadSocketHandler2() Inactivity checks #1538 (@iFoggz)
 - Update outdated checkpoints #1539 (@barton2526)
 - Change needed to build Gridcoin for OSX using homebrew #1540 (@Git-Jiro)
 - Optimize scraper traffic for expiring manifests #1542 (@jamescowens)
 - Move legacy neural vote warnings to debug log level #1560 (@cyrossignol)
 - Change banlist save interval to 5 minutes #1564 (@jamescowens)
 - Change default rpcconsole.ui window size to better support new Peers tab #1566 (@jamescowens)

Removed
 - Remove deprecated RSA weight and legacy kernel #1507 (@cyrossignol)

Fixed
 - Clean up compiler warnings #1521 (@cyrossignol)
 - Handle missing external CPID in client_state.xml #1530 (@cyrossignol)
 - Support boost 1.70+ #1533 (@iFoggz)
 - Fix diagnostics failed to make connection to NTP server #1545 (@Git-Jiro)
 - Install manpages in correct system location #1546 (@Git-Jiro)
 - Fix ability to show help and version without a config file #1553 (@cyrossignol)
 - Refactor QT UI variable names to be more consistent, Fix Difficulty default #1563 (@barton2526)
 - Fix two regressions in previous UI refactor #1565 (@barton2526)
 - Fix "Owed" amount in output of "magnitude" RPC method #1569 (@cyrossignol)
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.

None yet

3 participants