Commit Graph

22700 Commits

Author SHA1 Message Date
PastaPastaPasta
d06c771c97
Merge pull request #5266 from PastaPastaPasta/v19-rc8
[19.x] backport: backport fix and bump to rc.8
2023-03-23 10:16:37 -05:00
pasta
5abc5c5f34
chore: bump version to rc.8 2023-03-23 10:07:04 -05:00
UdjinM6
9b98d5f90b
fix(governance): Do not keep triggers longer than nSuperblockCycle (#5268)
## Issue being fixed or feature implemented
Keeping too many triggers on testnet and syncing them can result in p2p
bans because some of these triggers might be invalid already. Limiting
their lifetime should help.

## What was done?


## How Has This Been Tested?

## Breaking Changes


## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-23 10:07:04 -05:00
PastaPastaPasta
6fb6311b7d
Merge pull request #5249 from knst/qt-create-wallet-fix
backport: bitcoin-core/gui#171
2023-03-23 10:07:04 -05:00
PastaPastaPasta
5214459ffb
ci: resolve gitian automation failures on dashevo repo (#5267)
## Issue being fixed or feature implemented
Automation in private dashevo GitHub was failing due to the branch
trying to be built not having the automation be the newer tagged based
system. as such, if you simply tag a commit from the dashpay repo and
try to build it using automation, the build would fail. This should
resolve the issue. Recommended to BP so that we don't have this issue
when building v19.x branch builds

## What was done?


## How Has This Been Tested?
Creating a docker image should now be as simple pushing a branch and tag
to dashevo/dash; start the automation on branch develop with tag
previously specified

## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-23 09:56:00 -05:00
PastaPastaPasta
020070e48b
fix: hpmn registration after revocation caused mining failure (#5265)
## Issue being fixed or feature implemented
We reset operator info on revocation; but then on replacement via new
register we try to "RemoveMN", which tries to remove platformNodeID but
that's already been cleared

## What was done?
Only try to delete platformNodeID if it's non-null

## How Has This Been Tested?
Mined with it on testnet; mining works

## Breaking Changes
This will fork off other testnet nodes, as this fixes the logic

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: Odysseas Gabrielides <odysseas.gabrielides@gmail.com>
2023-03-23 09:56:00 -05:00
PastaPastaPasta
bfbd91204f
Merge pull request #5261 from ogabrielides/rc7_bump
chore: bump version to rc.7
2023-03-20 17:51:35 -05:00
Odysseas Gabrielides
e0fe6e49e0 chore: bump version to rc.7 2023-03-20 18:20:29 +02:00
UdjinM6
6f2e6f47ee chore: Move logs about nConsecutivePayments under MNPAYMENTS debug category (#5251)
## Issue being fixed or feature implemented
These messages are pretty annoying on reindex and shouldn't really be
shown in logs unless you actually need to debug mn payments.

## What was done?
move messages under `MNPAYMENTS` debug category

## How Has This Been Tested?
reindex

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-20 18:04:56 +02:00
Odysseas Gabrielides
e0e86cffd5 fix: check HPMNs duplicate on tx broadcast (#5257)
<!--
*** Please remove the following help text before submitting: ***

Provide a general summary of your changes in the Title above

Pull requests without a rationale and clear improvement may be closed
immediately.

Please provide clear motivation for your patch and explain how it
improves
Dash Core user experience or Dash Core developer experience
significantly:

* Any test improvements or new tests that improve coverage are always
welcome.
* All other changes should have accompanying unit tests (see
`src/test/`) or
functional tests (see `test/`). Contributors should note which tests
cover
modified code. If no tests exist for a region of modified code, new
tests
  should accompany the change.
* Bug fixes are most welcome when they come with steps to reproduce or
an
explanation of the potential issue as well as reasoning for the way the
bug
  was fixed.
* Features are welcome, but might be rejected due to design or scope
issues.
If a feature is based on a lot of dependencies, contributors should
first
  consider building the system outside of Dash Core, if possible.
-->

## Issue being fixed or feature implemented
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
Before this fix, uniqueness of HPMN `platformNodeID` was checked only
while processing a block containing a `ProRegTx` or a `ProUpServTx`.
This is not enough as a `ProRegTx` or `ProUpServTx` containing duplicate
HPMN `platformNodeID` must be rejected at tx broadcast level.

## What was done?
<!--- Describe your changes in detail -->
Checking uniqueness when calling respective RPC and when receiving such
txs.

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->


## Breaking Changes
<!--- Please describe any breaking changes your code introduces -->


## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-20 18:04:33 +02:00
PastaPastaPasta
bbab474c92 Merge pull request #5258 from kittywhiskers/update_dashbls
depends: update 'src/dashbls' to dashpay/bls-signatures@9329803 as c1992c1
2023-03-20 18:04:06 +02:00
Odysseas Gabrielides
79dbb0d739 feat: isdlock support without quorum rotation (regtest only) (#5259) 2023-03-20 18:03:40 +02:00
PastaPastaPasta
c4cf446100
Merge pull request #5250 from PastaPastaPasta/v19/bump-rc.6
[v19.x] backport: backports and rc.6 bump
2023-03-13 11:56:31 -05:00
pasta
cdb9d68720
chore: bump to rc.6 2023-03-13 11:26:25 -05:00
UdjinM6
b428c55db8
refactor: tweak GetLLMQ to fail gracefully and let caller handle results accordingly (#5247)
This allows us to have a bit more granular control over GetLLMQ results,
removes code duplication and also optimises things a tiny bit by
replacing "HasLLMQ + GetLLMQParams" calls with simply "GetLLMQParams".

Use `optional` in `GetLLMQ`, drop `HasLLMQ`.

run tests, reindex on testnet/mainnet

n/a

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-13 11:25:18 -05:00
Odysseas Gabrielides
bb4a1add2c
feat: Bumped v19 start time for v19 (#5244)
## Issue being fixed or feature implemented
Delayed activation to reexperience rc.6

## What was done?


## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-13 11:24:24 -05:00
Odysseas Gabrielides
ee60e8a6c4
feat(rpc): Return HPMN fields (#5243)
## Issue being fixed or feature implemented
HPMN fields were missing when selecting a HPMN in Masternodes tab of Qt
client.

## What was done?
Return HPMN fields in JSON reply of `CDeterministicMNState`.

## How Has This Been Tested?


## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-13 11:24:06 -05:00
Odysseas Gabrielides
323b290545
fix: governance correct sig check (#5242)
## Issue being fixed or feature implemented

## What was done?
When verifying signature of `CGovernanceVote`/`CGovernanceObject` we
need to use the active scheme.

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-13 11:23:56 -05:00
Odysseas Gabrielides
adcd52e678
chore(rpc): removed protx_revoke_legacy (#5241)
## Issue being fixed or feature implemented


## What was done?
Removed protx_revoke_legacy since it required a BLS secret key and not a
BLS public key.
(BLS scheme is not applicable to secret keys)

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-13 11:23:39 -05:00
Odysseas Gabrielides
5f26a7b85c
fix: BLS checkMalleable protection (#5240)
<!--
*** Please remove the following help text before submitting: ***

Provide a general summary of your changes in the Title above

Pull requests without a rationale and clear improvement may be closed
immediately.

Please provide clear motivation for your patch and explain how it
improves
Dash Core user experience or Dash Core developer experience
significantly:

* Any test improvements or new tests that improve coverage are always
welcome.
* All other changes should have accompanying unit tests (see
`src/test/`) or
functional tests (see `test/`). Contributors should note which tests
cover
modified code. If no tests exist for a region of modified code, new
tests
  should accompany the change.
* Bug fixes are most welcome when they come with steps to reproduce or
an
explanation of the potential issue as well as reasoning for the way the
bug
  was fixed.
* Features are welcome, but might be rejected due to design or scope
issues.
If a feature is based on a lot of dependencies, contributors should
first
  consider building the system outside of Dash Core, if possible.
-->

## Issue being fixed or feature implemented
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->


## What was done?
<!--- Describe your changes in detail -->


## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->


## Breaking Changes
<!--- Please describe any breaking changes your code introduces -->


## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2023-03-13 11:23:30 -05:00
Odysseas Gabrielides
ce524c4a54
fix: mnUniquePropertyMap repopulate for v19 (#5239)
## Issue being fixed or feature implemented
`CDeterministicMNList` stores internally a map containing the hashes of
all properties that needed to be unique.
`pubKeyOperator` don't differ between the two schemes (legacy and
basic(v19)) but their serialisation do: hence their hash.
Because this internal map stores only hashes, then we need to
re-calculate hashes and repopulate.

So when we tried to revoke a masternode after the fork, the `ProUpRevTx`
couldn't be mined because the hash of the `pubKeyOperator` differed.

## What was done?
When retrieving a `CDeterministicMNList` for a given block, if v19 is
active for that block, then we repopulate the internal map.

## How Has This Been Tested?
Without this fix, `feature_dip3_v19.py` is failing with
`failed-calc-cb-mnmerkleroot` (Error encountered on Testnet)

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: pasta <pasta@dashboost.org>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-03-13 11:23:20 -05:00
Odysseas Gabrielides
14c63af1ef
docs(rpc): correct help for protx legacy versions (#5234)
## Issue being fixed or feature implemented
Help text for protx legacy versions were adjusted.

## What was done?


## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: thephez <thephez@users.noreply.github.com>
2023-03-13 11:23:07 -05:00
PastaPastaPasta
4f97133dd6
Merge pull request #5232 from PastaPastaPasta/v19.x-delay-hf-rc.5
[V19.x] backport: delay hf rc.5
2023-03-02 11:00:06 -06:00
pasta
103523d221
chore: bump to rc.5 2023-03-02 10:57:39 -06:00
UdjinM6
66b0cf74ce
fix: postpone v19 hf start time on testnet (#5231)
## Issue being fixed or feature implemented
Block 847000 hf should happen somewhere around March 4th. We need mining
nodes to be upgraded to follow that chain and mine correct blocks.
However we don't want v19 to be activated shortly after (~300 blocks),
we want to give it a little bit of time to let (new) platform quorums
form and make sure everything is ok. With this patch we should have ~2
days (instead of half of a day).

## What was done?
bumped v19 activation start time to March 6th


## How Has This Been Tested?
n/a

## Breaking Changes
yes :)

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [ ] I have assigned this pull request to a milestone
2023-03-02 10:56:43 -06:00
PastaPastaPasta
a79d434d84
Merge pull request #5228 from PastaPastaPasta/v19-new-llmq
[v19.x] backport: new llmq and rc.4 bump
2023-03-01 14:43:39 -06:00
UdjinM6
45da082dda
fix(doc): fix release-notes-5225.md (#5230)
## Issue being fixed or feature implemented
make linter happy, fix failures like
https://gitlab.com/dashpay/dash/-/jobs/3858504407

## What was done?
drop trailing whitespace

## How Has This Been Tested?
`COMMIT_RANGE=1a810ca07d..HEAD ./test/lint/lint-whitespace.sh `
fails on develop, passes on this branch

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-01 13:52:03 -06:00
pasta
f63676ba5f
chore: bump version to rc.4 2023-03-01 13:09:00 -06:00
Odysseas Gabrielides
0bcf96311f
feat(llmq): llmq_test_dip0024 adjustments (#5229)
## Issue being fixed or feature implemented

## What was done?

## How Has This Been Tested?

## Breaking Changes
After the DIP24 fork, instant locks will still be served by
`llmq_test_instantsend`, since no `llmq_test_dip0024` will be formed
with less than 4 nodes.

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-03-01 13:09:00 -06:00
Odysseas Gabrielides
eae0cbacb7
feat(llmq): llmq_25_67 for Platform (Testnet only) (#5225)
## Issue being fixed or feature implemented

## What was done?
- Added new LLMQ type `llmq_25_67`
- The above LLMQ is added only for Testnet and it is activated with v19
fork.

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: pasta <pasta@dashboost.org>
2023-03-01 11:47:17 -06:00
PastaPastaPasta
ccea5abba7
Merge pull request #5224 from ogabrielides/rc3_v19_bump
chore: bump version to rc.3
2023-02-28 11:12:24 -06:00
Odysseas Gabrielides
5826464fc9 chore: Bump MIN_MASTERNODE_PROTO_VERSION for v19 (#5223)
## Issue being fixed or feature implemented

## What was done?
`MIN_MASTERNODE_PROTO_VERSION` was bumped to match latest
`PROTOCOL_VERSION`.

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-02-28 18:13:03 +02:00
Konstantin Akimov
088c8a55d2 fix: making builds of guix to produce same output whatever git config (#5222)
Builds are different, because git command output are different:




## Issue being fixed or feature implemented
in pr #5194 different OS produced different hashes of binary.
That's due to different behaviour of this command:
```sh
$ git rev-parse --short HEAD
b3f242da14 - on my localhost Kubuntu 22.10
b3f242da1 - inside pastapastapasta's docker
```

## What was done?
This fix forces to git print always 12 character


## How Has This Been Tested?
Run in different environment

## Breaking Changes
No breaking changes


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have assigned this pull request to a milestone
2023-02-28 18:12:23 +02:00
UdjinM6
db978cef54 fix(qt): Overview page should always be accessible (#5221)
## Issue being fixed or feature implemented
Overview page shows either wallet info or "Create wallet" button. Unlike
in bitcoin we can switch to other pages even when no wallets are enabled
(because we have Masternodes and Governance tabs) but then there is no
way to return back to Overview page.

## What was done?
Keep Overview tab always enabled. Make a no-wallet groupbox a member of
`WalletFrame` and add logic to switch to it when needed.

## How Has This Been Tested?
`./src/qt/dash-qt --regtest --nowallet`

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [ ] I have assigned this pull request to a milestone

PS. kudos to @thephez for reporting :)
2023-02-28 18:12:00 +02:00
Konstantin Akimov
c83d4881df chrore: bump version in gitian to 19 (#5220)
Name of some files in gitian's build contains "18" instead 19.

## Issue being fixed or feature implemented


## What was done?
Version bumped in gitian's related configs

## How Has This Been Tested?
Will be tested with next RC of v19

## Breaking Changes
No breaking changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
@PastaPastaPasta may you update release TODO checklist, please?
- [x] I have assigned this pull request to a milestone
2023-02-28 18:11:33 +02:00
Odysseas Gabrielides
368e48cb16 bump rc3 2023-02-28 17:55:37 +02:00
PastaPastaPasta
fa5a9674e0
Merge pull request #5219 from PastaPastaPasta/v19.x-bp-rc.2
backport: backport minor changes into v19.x and version bump
2023-02-22 12:40:29 -06:00
pasta
593034b6f2
chore: bump version to rc.2 2023-02-22 11:15:16 -06:00
Odysseas Gabrielides
01ebd60187
fix(rpc): don't parse platformHTTPPort platformP2PPort as strings (#5217)
## Issue being fixed or feature implemented
In `protx register_hpmn`, `protx register_fund_hpmn`, `protx
register_prepare_hpmn` and `protx update_service_hpmn` the fields
`platformHTTPPort` and `platformP2PPort` were parsed as strings instead
of integers.

## What was done?

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-02-22 11:14:55 -06:00
PastaPastaPasta
3a24170ac3
chore: set the nStartTime for v19 deployment Fed 22 and March 31st respectively (#5218)
## Issue being fixed or feature implemented

## What was done?

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-02-22 11:14:54 -06:00
Odysseas Gabrielides
38c481ce25
chore: Added missing protx rpc in help (#5216)
## Issue being fixed or feature implemented


## What was done?
`update_registrar_legacy` was missing from the protx help output.

## How Has This Been Tested?

## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-02-22 11:14:54 -06:00
pasta
e7c3abe362
chore: update version to v19.0.0-rc.1 2023-02-20 09:28:41 -06:00
PastaPastaPasta
eaf1fa2394
Merge pull request #5194 from knst/guix
contrib: Enable building in Guix containers
2023-02-20 09:12:10 -06:00
Wladimir J. van der Laan
f57668099e Merge #18702: build: fix ASLR for bitcoin-cli on Windows
315a4d36f716341a38bc4e4de8630b3246d27dbc build: fix ASLR for bitcoin-cli on Windows (fanquake)

Pull request description:

  ASLR is not currently working for the `bitcoin-cli.exe` binary. This is
  due to it not having a .reloc section, which is stripped by default by
  the mingw-w64 ld we use for gitian builds. A good summary of issues with
  ld and mingw-w64 is available in this thread:
  https://sourceware.org/bugzilla/show_bug.cgi?id=19011.

  All other Windows binaries that we distribute (bitcoind, bitcoin-qt,
  bitcoin-wallet, bitcoin-tx and test_bitcoin) do not suffer this issue,
  and currently having working ASLR. This is due to them exporting
  (inadvertent or not) libsecp256k1 symbols, and, as a result, the .reloc
  section is not stripped by ld.

  This change is a temporary workaround, also the same one described here:
  https://www.kb.cert.org/vuls/id/307144/, that causes main() to be
  exported. Exporting a symbol will mean that the .reloc section is not
  stripped, and ASLR will function correctly.

  Ultimately, this will be fixed by using a newer version of binutils (that has this [change](https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=dc9bd8c92af67947db44b3cb428c050259b15cd0)). Whether that's through bumping our gitian distro, or Guix.

  Related to #18629, which has a bunch of additional information in the PR description. If you would like to verify whether or not ASLR is indeed working, with or without this change. One easy way to check is using a tool like [VMMap](https://docs.microsoft.com/en-us/sysinternals/downloads/vmmap).

  Here are the memory mappings for the 0.20.0rc1 `bitcoind.exe` and `bitcoin-cli.exe` binaries. You'll notice that over machine restarts, even though the image is marked `(ASLR)` (which I assume may be due to the header bit being set), no ASLR is actually occuring for `bitcoin-cli.exe`:

  #### bitcoind.exe

  ![bitcoind-1](https://user-images.githubusercontent.com/863730/79678203-74065c80-822b-11ea-90bc-9c883d0aeefa.png)

  ![bitcoind-2](https://user-images.githubusercontent.com/863730/79678204-7668b680-822b-11ea-9263-3e7ba22f904c.png)

  ![bitcoind-3](https://user-images.githubusercontent.com/863730/79678206-7963a700-822b-11ea-972f-af31a514b9b4.png)

  #### bitcoin-cli.exe

  ![bitcoin-cli-1](https://user-images.githubusercontent.com/863730/79678208-7ec0f180-822b-11ea-8480-a4b5d1762945.png)

  ![bitcoin-cli-2](https://user-images.githubusercontent.com/863730/79678213-81bbe200-822b-11ea-964d-994f58ff12b0.png)

  ![bitcoin-cli-3](https://user-images.githubusercontent.com/863730/79678215-84b6d280-822b-11ea-9cd6-fee2e239c003.png)

ACKs for top commit:
  dongcarl:
    ACK 315a4d36f716341a38bc4e4de8630b3246d27dbc
  laanwj:
    ACK 315a4d36f716341a38bc4e4de8630b3246d27dbc

Tree-SHA512: 95f4dc15420ed9bcdeacb763e11c3c7e563eec594a172746fa0346c13f97db3a8769357dffc89fea1e57ae67133f337b1013a73b584662f5b6c4d251ca20a2b1
2023-02-20 09:09:23 -06:00
fanquake
700d46b26d Merge #18741: guix: Make source tarball using git-archive
bfe1ba2f5b36056e0c41edf8206b93d3d83098df rel-builds: Specify core.abbrev for git-rev-parse (Carl Dong)
27e63e01cce368d67092de8f0c736927d6f6aa69 build: Accomodate makensis v2.x (Carl Dong)
1f2c39a30e0f82046c7aecddfda3eb99cb536816 guix: Remove logical cores requirement (Carl Dong)
a4f6ffa71e335d4b2a6bf525b7f416968f9cd9f7 lint: Also enable source statements for non-gitian (Carl Dong)
d256f91cb1b0d6ff5170106b99b0266cbe51f5a2 rel-builds: Directly deploy win installer to OUTDIR (Carl Dong)
fa791da02f9684e3fd554b687fb692ae6a23d65a nsis: Specify OutFile path only once (Carl Dong)
14701604d0904bc5bbf1c67de08f8ee6d3215523 guix: Expose GIT_COMMON_DIR in container as readonly (Carl Dong)
f5a6ac4f48b18f93050d77bcb23f9cf45ec34647 guix: Make source tarball using git-archive (Carl Dong)
395c1137f630dc495ffb2752a23bc1dfd470ee53 gitian: Limit sourced script to just assignments (Carl Dong)

Pull request description:

  Based on: #18556
  Related: https://github.com/bitcoin/bitcoin/pull/17595#discussion_r399728721

ACKs for top commit:
  fanquake:
    ACK bfe1ba2f5b36056e0c41edf8206b93d3d83098df - I agree with Carl, and am going to merge this. I'd like for Linux Guix builds to be working again, and we can rebase #18818.

Tree-SHA512: c87ada7e3de17ca0b692a91029b86573442ded5780fc081c214773f6b374a0cdbeaf6f6898c36669c2e247ee32aa7f82defb1180f8decac52c65f0c140f18674
2023-02-20 09:09:23 -06:00
fanquake
87de9c8f5c Merge #17929: build: add linker optimisation flags to gitian & guix (Linux)
f2b5b0a3b48f9241971c14238040048f8b630811 build: add linker optimization flags to guix (fanquake)
b8b050a8d642e38c81d1e451750c2c8db92fee5e build: add linker optimization flags to gitian descriptors (fanquake)

Pull request description:

  This PR adds `-Wl,O2` to our gitian and guix LDFLAGS. This makes the linker perform certain optimisations (and is different from LTO).

  Any -O argument will enable optimizations in GNU ld. We can use -O2 here, as this matches our compile flags. Note that this would also enable additional optimizations if using the lld or gold linkers, when compared to -O0.

  A nice writeup + diagrams of some of these optimizations is  available here: http://lwn.net/Articles/192624/.

  #### master
  ```bash
  # bitcoind
  Histogram for `.gnu.hash' bucket list length (total of 3 buckets)
   Length  Number     % of total  Coverage
        0  1          ( 33.3%)       0.0%
        1  0          (  0.0%)       0.0%
        2  1          ( 33.3%)      40.0%
        3  1          ( 33.3%)     100.0%
  ```
  ```bash
  # bitcoin-qt
  Histogram for `.gnu.hash' bucket list length (total of 3 buckets)
   Length  Number     % of total  Coverage
        0  0          (  0.0%)       0.0%
        1  1          ( 33.3%)      10.0%
        2  0          (  0.0%)      10.0%
        3  0          (  0.0%)      10.0%
        4  1          ( 33.3%)      50.0%
        5  1          ( 33.3%)     100.0%
  ```

  #### this PR:
  ```bash
  # bitcoind
  Histogram for `.gnu.hash' bucket list length (total of 8 buckets)
   Length  Number     % of total  Coverage
        0  3          ( 37.5%)       0.0%
        1  5          ( 62.5%)     100.0%
  ```
  ```bash
  # bitcoin-qt
  Histogram for `.gnu.hash' bucket list length (total of 19 buckets)
   Length  Number     % of total  Coverage
        0  9          ( 47.4%)       0.0%
        1  10         ( 52.6%)     100.0%
  ```

  #### GNU ld -O

  > If level is a numeric values greater than zero ld optimizes the output. This might take significantly longer and therefore probably should only be enabled for the final binary. At the moment this option only affects ELF shared library generation. Future releases of the linker may make more use of this option. Also currently there is no difference in the linker’s behaviour for different non-zero values of this option. Again this may change with future releases.

  #### lld -O

  > Optimize output file size

ACKs for top commit:
  dongcarl:
    ACK f2b5b0a3b48f9241971c14238040048f8b630811
  laanwj:
    ACK f2b5b0a3b48f9241971c14238040048f8b630811

Tree-SHA512: e53f3a4338317dbec65d3a93b57b5a6204aabdf9ac82d99447847a3c8627facc53c58c2cf947376f13edd979fc8129a80f18d9ebeccd191a576c83f1dad5c513
2023-02-20 09:09:23 -06:00
fanquake
dff599acff Merge #17595: guix: Enable building for x86_64-w64-mingw32 target
a35e3235891d35daa167116cc70340140e883f06 guix: Appease travis. (Carl Dong)
0b66d22da5f53640e22f05adf880782c613e6d0f guix: Use gcc-9 for mingw-w64 instead of 8 (Carl Dong)
ba0b99bdd613ba7f17c6247ece3001e1b44759a3 guix: Don't set MINGW_HAS_SECURE_API CFLAG in depends (Carl Dong)
93439a71eda49fb69f1e82966a23a946733aa6fa guix: Bump to upstream commit with mingw-w64 changes (Carl Dong)
35a96792dda9e78165b1598aeac7b2ab759e7be5 guix: Check mingw symbols, improve SSP fix docs (Carl Dong)
449d8fe25bbe25daacfc67aa89ca32b0a3254c5a guix: Expand on INT trap message (Carl Dong)
3f1f03c67a8e9edf487f08d272adb18b0a3942c8 guix: Spelling fixes (Carl Dong)
ff821dd2a1c600488d11e7d9a20e9179ecc9144b guix: Reinstate make-ssp-fixed-gcc (Carl Dong)
360a9e0ad50a36ec79a1a160dbed3966689fd41c guix: Bump time-machine for mingw-w64 patches (Carl Dong)
93e41b7e3b54c17fd1b4c61ee95fc0dc2827e954 guix: Use gcc-8 for mingw-w64 instead of 7 (Carl Dong)
ef4f7e4c45c60a69406134122f091c77c6ef740f guix: Set the well-known timezone env var (Carl Dong)
acf4b3b3b5accf60a19441a0298ef27001b78e72 guix: Make x86_64-w64-mingw32 builds reproducible (Carl Dong)
c4cce00eac691625b78b92f7dba0b7f57def19e5 guix: Remove dead links from README. (Carl Dong)
df953a4c9a6143f45864757b706c88b6fa70545a guix: Appease shellcheck. (Carl Dong)
91897c95e191d293eb27d8af15cbeafc5b8f3895 guix: Improve guix-build.sh documentation (Carl Dong)
570d769c6c59b9f6d1a2b95b2ed60432cb33b3ba guix: Build support for Windows (Carl Dong)

Pull request description:

  ~~Based on: https://github.com/bitcoin/bitcoin/pull/16519~~
  Based on: #17933 (Time Machines are... shall we say... superior 😁)

  This PR allows us to perform Guix builds for the `x86_64-w64-mingw32` target. We do this _without_ splitting up the build script like we do in Gitian by using this newfangled alien technology called `case` statements. (This is WIP and might be changed to `if` statements soon)

ACKs for top commit:
  fanquake:
    ACK a35e3235891d35daa167116cc70340140e883f06 2/3

Tree-SHA512: c471951c23eb2cda919a71285d8b8f2580cb20f09d5db17b53e13dbd8813e01b3e7a83ea848e4913fd0f2bc12c6c133c5f76b54e65c0d89fed4dfd2e0be19875
2023-02-20 09:09:23 -06:00
fanquake
355a735e78 Merge #18320: guix: Remove now-unnecessary gcc make flag
0ae42a16c766a7ecb8711bfad6f22b8581ea0258 guix: Remove now-unnecessary gcc make flag (Carl Dong)

Pull request description:

  ```
  Previously, Guix would produce a gcc which did not know to use the SSP
  function from glibc, and required a gcc make flag for it to do so, in my
  attempt to fix it upstream I realized that this is no longer the case.

  This can be verified by performing a Guix build and doing

    readelf -s ... | grep __stack_chk

  to check that symbols are coming from glibc, and doing

    readelf -d ... | grep NEEDED | grep ssp

  to see that libssp.so is not being depended on
  ```

ACKs for top commit:
  fanquake:
    ACK 0ae42a16c766a7ecb8711bfad6f22b8581ea0258 - ran a Guix build (hashes below) and checked all the linux binaries:

Tree-SHA512: 701b91e7c323b12a29af9539cb2656d10ce0a93af573a02e57f0b7fea05a6e1819798536eadb24d0a17e7f35b503f5e863fee5e7409db1b8a3973c4375e49d4e
2023-02-20 09:09:23 -06:00
fanquake
1f9f160d24 Merge #18104: build: Skip i686 build by default in guix and gitian
fae9084ac5b10f94bdee54853d307838c4254e9c build: Skip i686 build by default in guix and gitian (MarcoFalke)
fa55a2554c2661b8f2a759044d5ac85c9979d9ca depends: Remove reference to win32 (MarcoFalke)

Pull request description:

  Closes #17504

  Now that we no longer provide downloads for i686 on our website (https://bitcoincore.org/en/download/), there is no need to build them by default.

  i686 can still be built in depends (tested by ci/travis) and in guix/gitian by setting the appropriate `HOSTS`.

ACKs for top commit:
  practicalswift:
    ACK fae9084ac5b10f94bdee54853d307838c4254e9c -- patch looks correct
  dongcarl:
    ACK fae9084ac5b10f94bdee54853d307838c4254e9c patch looks correct
  laanwj:
    Code review ACK fae9084ac5b10f94bdee54853d307838c4254e9c
  hebasto:
    ACK fae9084ac5b10f94bdee54853d307838c4254e9c, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: b000c19a2cd2a596a52028fa298c4022c24cfdfc1bdb3795a90916d0a00a32e4dd22278db93790b6a11724e08ea8451f4f05c77bc40d1664518e11a8c82d6e29
2023-02-20 09:09:23 -06:00
fanquake
359c0fd62b Merge #17933: guix: Pin Guix using guix time-machine
88c83636d5a56bd9551577139786bdd3e74852c2 guix: Update documentation for time-machine (Carl Dong)
e6050884fdabfa6e51e6afce2041d91e60a5adec guix: Pin Guix using `guix time-machine` (Carl Dong)

Pull request description:

  An alternative to #16519, pinning our version of Guix and eliminating a `guix pull` and changing the default Guix profile of builders.

  I think this method might be superior, as it:
  - Eliminates the possibility of future changes to the `guix environment` command line interface breaking our builds
  - Eliminates the need to set up a separate channel repo

  It is a more general pinning solution than #16519.

  -----

  The reason why I didn't originally propose this is because `guix time-machine` is a recent addition to Guix, only available since `f675f8dec73d02e319e607559ed2316c299ae8c7`

ACKs for top commit:
  fanquake:
    ACK 88c83636d5a56bd9551577139786bdd3e74852c2

Tree-SHA512: 85e03b0987ffa86da73e02801e1cd8b7622698d70c4ba4e60561611be1e9717d661c2811a59b3e137b1b8eef2d0ba37c313867d035ebc89c3bd06a23a078064a
2023-02-20 09:09:23 -06:00