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

[0.17] Add pegin validation #458

Merged
merged 20 commits into from
Jan 2, 2019

Conversation

stevenroose
Copy link
Member

No description provided.

@stevenroose stevenroose changed the base branch from elements-0.14.1 to elements-0.17 November 7, 2018 17:31
@stevenroose stevenroose changed the title [WIP; 0.17] Add pegin validation [WIP, 0.17] Add pegin validation Nov 7, 2018
src/init.cpp Outdated Show resolved Hide resolved
src/init.cpp Outdated Show resolved Hide resolved
src/init.cpp Outdated Show resolved Hide resolved
src/chainparams.cpp Outdated Show resolved Hide resolved
@stevenroose stevenroose force-pushed the e17-pegins branch 2 times, most recently from 60307e0 to d345979 Compare November 15, 2018 17:23
@stevenroose
Copy link
Member Author

Want to point out explicitly that I removed a check in AcceptToMempoolWorker in a9c0331.

It seems that that AcceptToMempoolWorker now calls CheckTxInputs while before it didn't do that. So that check seemed to be redundant there. I hope I'm not wrong about that.

@instagibbs
Copy link
Collaborator

That was something you had added, right?

@stevenroose
Copy link
Member Author

@instagibbs yeah yeah of course. I added it by porting back, but then realized I added the check twice since it was also in CheckTxInputs. elements-0.14.1 has the pegin double-pegin-spend check separate: in CheckTxInputs for ConnectTip and separate independent for AcceptToMempoolWorker.

@stevenroose stevenroose force-pushed the e17-pegins branch 2 times, most recently from f2d87aa to 2a46806 Compare December 13, 2018 13:51
laanwj added a commit to bitcoin/bitcoin that referenced this pull request Dec 13, 2018
98a1846 tests: Support calling add_nodes more than once (Steven Roose)

Pull request description:

  Ran into this while writing [a multi-chain test for Elements](ElementsProject/elements#458) where I call this method more than once.

Tree-SHA512: f2d698fcb560552aa5d81a4c3fbf40b7269b228b34d85a118291649ef83f8c0a30cd82a28d418237b55893bcecd538046b704e64a4d8a41f2c0aef8033dc83e5
@stevenroose stevenroose force-pushed the e17-pegins branch 2 times, most recently from 181edea to b69eb3b Compare December 14, 2018 16:26
@instagibbs
Copy link
Collaborator

i poked the integration tests so I can see results outside of linter's complaints

@instagibbs
Copy link
Collaborator

pegins.cpp: In function ‘bool IsValidPeginWitness(const CScriptWitness&, const COutPoint&, bool)’:
pegins.cpp:317:37: warning: ‘num_txs’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         if (!IsConfirmedBitcoinBlock(block_hash, Params().GetConsensus().pegin_min_depth, num_txs)) {
                                     ^
pegins.cpp:263:9: note: ‘num_txs’ was declared here
     int num_txs;

src/pegins.cpp Outdated Show resolved Hide resolved
src/pegins.cpp Outdated Show resolved Hide resolved
EnsureWalletIsUnlocked(pwallet);

mapValue_t mapValue;
CCoinControl no_coin_control; // This is a deprecated API
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what part is deprecated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. I mimicked existing code. I found the original comment was placed in ecd81df.

@stevenroose
Copy link
Member Author

About that warning, that's because there is a signed block case that I commented out that is impossible to get into for now. It's gated behind bool ParentChainHasPow() const { return parent_chain_signblockscript == CScript();} that is always true.

src/txdb.cpp Show resolved Hide resolved
src/txdb.cpp Show resolved Hide resolved
src/txdb.cpp Outdated Show resolved Hide resolved
src/txdb.cpp Show resolved Hide resolved
@instagibbs
Copy link
Collaborator

utACK aee6880

that intermittant test failure is really hard to trigger and is an important exception to force the user to restart important services anyways. I'm not going to let that be a blocker for merge.

@instagibbs
Copy link
Collaborator

re-utACK d358364

@instagibbs instagibbs merged commit d358364 into ElementsProject:elements-0.17 Jan 2, 2019
instagibbs added a commit that referenced this pull request Jan 2, 2019
d358364 Integration test for pegins and pegouts (Steven Roose)
d888540 Add support for signed-blocks parent chains (Steven Roose)
b56f7da Add pegin and pegout RPC calls (Steven Roose)
7bb9380 Recognize pegout scripts (Steven Roose)
4688e3e Add periodic RPC recheck and invalid block recheck (Steven Roose)
0e4e834 Add pegin validation unit tests (Steven Roose)
5cbb014 Validation of pegin inputs (Steven Roose)
f4adb46 Add spentness flag to pegin coins (Steven Roose)
0d07d21 Change CCoinsMapKey to use chain-aware outpoints (Steven Roose)
22ec499 Add "vdata" field to createrawtransaction rpc (Steven Roose)
2db1f2b Add tweakfedpegscript rpc (Steven Roose)
d6686b6 Add getsidechaininfo rpc (Steven Roose)
fb8a453 Add pegin validation utility methods (Steven Roose)
037b260 Serialize parent blocks without pegin flags (Steven Roose)
89613b8 Skip normal validation of pegin inputs (Steven Roose)
ae54d4a Add pegin input serialization (Steven Roose)
ac1eadd Add support for NullData addresses (OP_RETURN) (Steven Roose)
18ee341 Add parent address encoding (Steven Roose)
d39d440 Add mainchain rpc client (Steven Roose)
238a72b Add arguments for parent chain characteristics (Steven Roose)
@stevenroose stevenroose deleted the e17-pegins branch March 25, 2019 14:12
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Aug 2, 2021
98a1846 tests: Support calling add_nodes more than once (Steven Roose)

Pull request description:

  Ran into this while writing [a multi-chain test for Elements](ElementsProject/elements#458) where I call this method more than once.

Tree-SHA512: f2d698fcb560552aa5d81a4c3fbf40b7269b228b34d85a118291649ef83f8c0a30cd82a28d418237b55893bcecd538046b704e64a4d8a41f2c0aef8033dc83e5
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Aug 3, 2021
98a1846 tests: Support calling add_nodes more than once (Steven Roose)

Pull request description:

  Ran into this while writing [a multi-chain test for Elements](ElementsProject/elements#458) where I call this method more than once.

Tree-SHA512: f2d698fcb560552aa5d81a4c3fbf40b7269b228b34d85a118291649ef83f8c0a30cd82a28d418237b55893bcecd538046b704e64a4d8a41f2c0aef8033dc83e5
gades pushed a commit to cosanta/cosanta-core that referenced this pull request May 12, 2022
98a1846 tests: Support calling add_nodes more than once (Steven Roose)

Pull request description:

  Ran into this while writing [a multi-chain test for Elements](ElementsProject/elements#458) where I call this method more than once.

Tree-SHA512: f2d698fcb560552aa5d81a4c3fbf40b7269b228b34d85a118291649ef83f8c0a30cd82a28d418237b55893bcecd538046b704e64a4d8a41f2c0aef8033dc83e5
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.

3 participants