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

SPV #20

Open
wants to merge 546 commits into
base: master
Choose a base branch
from
Open

SPV #20

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
546 commits
Select commit Hold shift + click to select a range
a837e4a
Fix indentation
OrfeasLitos Oct 23, 2017
d04f1bf
Remove logging
OrfeasLitos Oct 23, 2017
0188667
Use pubkeyhash instead of address
OrfeasLitos Oct 23, 2017
feef3e5
Try to use generated keyring instead of fixture
OrfeasLitos Oct 23, 2017
0a0ec84
Include minimal.js in .gitignore
OrfeasLitos Oct 23, 2017
343e105
Have both miner and spvNode wait for specific tx
OrfeasLitos Oct 24, 2017
5ae1f44
Save addresses and keyrings to new vars
OrfeasLitos Oct 24, 2017
cd2095b
Use addresses and keyrings from variables
OrfeasLitos Oct 24, 2017
41806af
Remove getTX() from spv and full nodes
OrfeasLitos Oct 24, 2017
b096b6f
Define TXRecord and use it in wallet.getTX()
OrfeasLitos Oct 24, 2017
e6c0143
Stop using local wallet
OrfeasLitos Oct 24, 2017
64257f9
Use entire keyring instead of private key
OrfeasLitos Oct 24, 2017
20e6feb
Get tx from the TXRecord
OrfeasLitos Oct 24, 2017
d5431e3
Add a console.log for debug
OrfeasLitos Oct 24, 2017
58cb9a0
add missing eve
OrfeasLitos Oct 24, 2017
d285949
Use local variables instead of fixtures
OrfeasLitos Oct 24, 2017
71ef9b0
Improve indentation
OrfeasLitos Oct 24, 2017
9c21632
Drop originPubKey, use method on keyring
OrfeasLitos Oct 24, 2017
45ccfff
Remove console.log from src/trust_is_risk
OrfeasLitos Oct 25, 2017
87bd128
Use private key instead of keyring
OrfeasLitos Oct 25, 2017
94c8a6b
Use coin semantics
OrfeasLitos Oct 25, 2017
02fe6c6
Remove testnet logic
OrfeasLitos Oct 25, 2017
da3b023
Use private key instead of keyring
OrfeasLitos Oct 25, 2017
c1eab88
Add static method fromTX() to bcoin
OrfeasLitos Oct 26, 2017
f29d558
Use bcoin.primitives.Coin instead of bcoin.coin
OrfeasLitos Oct 26, 2017
cf5c905
Add missing await before WalletDB.addTX()
OrfeasLitos Oct 27, 2017
70fed11
Add network data to generalize pubKeyToEntity()
OrfeasLitos Oct 28, 2017
7d6484b
Improve indentation and appearance
OrfeasLitos Oct 28, 2017
186895f
Declare Address.types.PUBKEYHASH with Flow
OrfeasLitos Oct 28, 2017
581057f
Declare "network" occurences as bcoin$Network
OrfeasLitos Oct 28, 2017
7c521c2
Use helpers.pubKeyToEntity() method
OrfeasLitos Oct 28, 2017
0598243
Remove redundant empty line
OrfeasLitos Oct 29, 2017
6bc02c5
Set regtest when requiring bcoin
OrfeasLitos Oct 29, 2017
2c78eef
Get network from options instead of hardcode
OrfeasLitos Oct 29, 2017
303ca28
Circumvent bcoin bug in pool.hasTX()
OrfeasLitos Oct 31, 2017
80f57a2
Reorder beforeEach() actions
OrfeasLitos Oct 31, 2017
7977001
Experiment with first spv test
OrfeasLitos Oct 31, 2017
34d2f09
Add minimal testcases
OrfeasLitos Oct 31, 2017
35693d3
Have flow ignore minimal_testcases/ directory
OrfeasLitos Nov 8, 2017
ca868f3
Fix typo
OrfeasLitos Nov 8, 2017
643a0cd
Add bloom.js testcase to debug node connectivity
OrfeasLitos Nov 8, 2017
b5e99d8
Pinpoint problem with adding TX to walletDB
OrfeasLitos Nov 11, 2017
97c5411
Simplify bloom.js minimal testcase
OrfeasLitos Nov 17, 2017
db73805
Simplify bloom.js minimal testcase
OrfeasLitos Nov 17, 2017
035fc44
Await properly for trigger setup
OrfeasLitos Nov 19, 2017
16077f8
Simplify bloom.js minimal testcase
OrfeasLitos Nov 17, 2017
92d4572
Await properly for trigger setup
OrfeasLitos Nov 20, 2017
b1c6f64
Merge branch 'spv-extension' of github.com:OrfeasLitos/TrustIsRisk.js…
OrfeasLitos Nov 20, 2017
e8a66b6
Remove watchAddress()
OrfeasLitos Nov 27, 2017
cd35c93
Change the debug console.log() messages
OrfeasLitos Nov 27, 2017
de03220
Add spv flag to walletDB creation
OrfeasLitos Nov 30, 2017
2869a97
Remove redundat console.log()s, add some delays
OrfeasLitos Nov 30, 2017
9b42fbc
Replace delays with waits for tx reception
OrfeasLitos Dec 4, 2017
35ec54f
Remove old shoulds and console.log()s
OrfeasLitos Dec 4, 2017
81d310c
Test that the final wallet balance is correct
OrfeasLitos Dec 4, 2017
1bc78bc
Increase tests time limit
OrfeasLitos Dec 4, 2017
3e313dc
Remove "only" from test
OrfeasLitos Dec 4, 2017
03a50db
Add should() for number of addTX() calls
OrfeasLitos Dec 5, 2017
d7e06c8
Increase test time limit
OrfeasLitos Dec 5, 2017
1f0febf
Renew debug console.log()s
OrfeasLitos Dec 5, 2017
a99edff
Have spv watch all addresses
OrfeasLitos Dec 5, 2017
c2fa7c4
Remember a tx and wait for it
OrfeasLitos Dec 5, 2017
f9dd580
Add ".only" to the current test
OrfeasLitos Dec 5, 2017
2aa6ada
Increase test time limit
OrfeasLitos Dec 11, 2017
7e05be2
Remove console.log() from test/helpers.js
OrfeasLitos Dec 11, 2017
eca7827
Remove console.log()s and ".only" from "it"
OrfeasLitos Dec 14, 2017
08a9fe8
Add more should()s
OrfeasLitos Dec 14, 2017
c7f01ac
Add note documenting bcoin library patch
OrfeasLitos Dec 14, 2017
7901c89
Remove redundant whitespace
OrfeasLitos Dec 14, 2017
0f1d32a
Replace hardcoded delay() with waitForTX()
OrfeasLitos Dec 14, 2017
93be70d
Type bloom filter add() function
OrfeasLitos Dec 18, 2017
c150267
Remove redundant whitespace
OrfeasLitos Dec 18, 2017
ac1b98b
Add await for tests to pass
OrfeasLitos Dec 18, 2017
857c7d4
Test if TIR tag is present in the spv bloom filter
OrfeasLitos Dec 18, 2017
41902e6
Add tag to the bloom filter in a different way
OrfeasLitos Dec 18, 2017
b0d6f81
Remove tag, rename fakePubKey to tag
OrfeasLitos Dec 19, 2017
7cb3cb6
Use should(...).be.true() instead of other forms
OrfeasLitos Dec 19, 2017
da04968
Reduce mocha timeout
OrfeasLitos Dec 19, 2017
e1a104f
Switch it.only to old test
OrfeasLitos Dec 19, 2017
57cc27d
Add local mtx validity tests
OrfeasLitos Dec 19, 2017
e7dc189
Copy verification process locally
OrfeasLitos Jan 5, 2018
dda3f06
Add comment on why TX is invalid
OrfeasLitos Jan 9, 2018
f28f91c
Add optimisation TODO comment
OrfeasLitos Jan 9, 2018
fc24a75
Type getTrustDecreasingMTX() return value
OrfeasLitos Jan 9, 2018
dba43dd
Use async/await to get trust decreasing txs
OrfeasLitos Jan 9, 2018
bb0e456
Remove manual tx verification and .only
OrfeasLitos Jan 10, 2018
3358ed9
Use coin instead of input for trust decreasing txs
OrfeasLitos Jan 10, 2018
30a14a4
Homogenize "should" syntax
OrfeasLitos Jan 12, 2018
3a7a21f
Rename getTrDecMTX() to createTrDecMTX()
OrfeasLitos Jan 12, 2018
673fd46
Join short lines
OrfeasLitos Jan 16, 2018
c67af0d
Merge full and spv trust increasing functions
OrfeasLitos Jan 16, 2018
98d2fb3
Let spv node decrease trust correctly
OrfeasLitos Jan 16, 2018
64c82ab
Add changes to note
OrfeasLitos Jan 16, 2018
2681739
Add suggestion from bcoin
OrfeasLitos Feb 12, 2018
3afc841
Add another suggestion from bcoin
OrfeasLitos Feb 13, 2018
8d6ba9c
Add minimal testcase for tx circulation
OrfeasLitos Feb 17, 2018
966fdd4
Remove old entry from .gitignore
OrfeasLitos Feb 17, 2018
8b4be67
Change spv sendTX() minimal testcase
OrfeasLitos Feb 23, 2018
00a5f47
Stop explicitly watching addresses
OrfeasLitos Feb 23, 2018
1769c1c
Fix bug in trust-is-risk test
OrfeasLitos Feb 26, 2018
c8f46e2
Use [email protected] in package.json
OrfeasLitos Feb 23, 2018
069c3e9
Change {from,to}Base58 to {from,to}String
OrfeasLitos Feb 23, 2018
a1f0b5b
Change from ec-secp256k1 to secp256k1
OrfeasLitos Feb 26, 2018
138ceca
Update walletDB setup
OrfeasLitos Feb 26, 2018
781caf9
Use httpPort instead of port option for nodes
OrfeasLitos Feb 26, 2018
5dd7dca
Add .data after all Output.script.get()
OrfeasLitos Feb 26, 2018
adfb079
Update scriptVector() usage
OrfeasLitos Feb 26, 2018
9178a66
Update flow types
OrfeasLitos Feb 28, 2018
1602c36
Create tir tag in separate file
OrfeasLitos Mar 2, 2018
662ec71
Remove obsolete note
OrfeasLitos Mar 3, 2018
ff1f3a8
Type walletPlugin class and relevant functions
OrfeasLitos Mar 3, 2018
44e92cd
Use crypto.secp256k1 instead of crypto.ec
OrfeasLitos Mar 3, 2018
386a055
Type node init, tag and wallet plugin stuff
OrfeasLitos Mar 15, 2018
86373d4
Use wallet plugin to setup walletDB
OrfeasLitos Mar 15, 2018
93d55e7
Remove address from tag
OrfeasLitos Mar 15, 2018
fa55ea8
Update EC to secp256k1
OrfeasLitos Mar 15, 2018
9c282e4
Type init/tear down node/walletDB functions
OrfeasLitos Mar 15, 2018
3c970e3
Define and use dedicated node.tearDown() functions
OrfeasLitos Mar 15, 2018
6a11ae4
Pass the node, not the walletDB to createWallet()
OrfeasLitos Mar 15, 2018
51e1ce6
Add minimal testcase for separating walletDB
OrfeasLitos Mar 15, 2018
78631e2
Have the user create and control walletDB
OrfeasLitos Mar 16, 2018
b1e3dc1
Fix typo
OrfeasLitos Mar 20, 2018
aa79d23
Use stub to return correct coin
OrfeasLitos Mar 23, 2018
258d9a4
Reorder createTrustDecreasingMTXs() arguments
OrfeasLitos Mar 23, 2018
5e6ac53
Add note for weekly update
OrfeasLitos Mar 23, 2018
8b18309
Test TrustIsRisk class both for full and spv node
OrfeasLitos Mar 29, 2018
848d5f4
Separate tag tests
OrfeasLitos Apr 1, 2018
7b4f330
Rename prevOutput to prevOutpoint
OrfeasLitos Apr 1, 2018
c861f13
Homogenize createTrustIncreasingMTX() for full/spv
OrfeasLitos Apr 1, 2018
655e6c4
Homogenize createTrustDecreasingMTX() for full/spv
OrfeasLitos Apr 1, 2018
675c7f7
Merge coin declaration and assignment
OrfeasLitos Apr 1, 2018
e4aa45b
Use wallet for createTrust{In,De}creasingMTX()
OrfeasLitos Apr 3, 2018
7ac5b8f
Simplify code
OrfeasLitos Apr 4, 2018
a65e66b
Use "get" syntax for valid and spendable
OrfeasLitos Apr 17, 2018
dfaf27c
Add minimal testcase for full/spv tx circulation
OrfeasLitos Apr 17, 2018
19c0c0d
Remove redundant await before mtx.verify()
OrfeasLitos May 11, 2018
c4217df
Add missing spaces
OrfeasLitos May 11, 2018
5bafae9
Attempt to fix last bugs
OrfeasLitos May 18, 2018
280b53c
Comments to improve test flakiness
dionyziz May 18, 2018
c81e365
Allow infinite timeout for tests
OrfeasLitos May 21, 2018
88a3618
Remove note
OrfeasLitos May 21, 2018
3963d92
Simplify waitForTrustDB()
OrfeasLitos May 21, 2018
1681048
Wait for one more tx in waitForTX()
OrfeasLitos May 21, 2018
a12f3c5
Rephrase should for clarity
OrfeasLitos May 21, 2018
ffd0cac
Wait for particular txs
OrfeasLitos May 21, 2018
ebd5926
Highlight problem when using waitForTX(tx)
OrfeasLitos May 22, 2018
e408a0c
Remove standard eslint checks
OrfeasLitos May 22, 2018
4e2babb
Use updated waitForTX() and flushEvents()
OrfeasLitos May 28, 2018
8c8aa33
Update waitForTX(), write flushEvents()
OrfeasLitos May 28, 2018
c5307c0
Remove "only" from test
OrfeasLitos May 29, 2018
70bd2ca
Remove "while (true) ... break" to satisfy linter
OrfeasLitos May 29, 2018
0431bfd
Disallow constant conditions by linter
OrfeasLitos May 29, 2018
e36c949
Allow unsafe getters and setters in Flow
OrfeasLitos May 29, 2018
c9ecc06
Improve console.log()s, add missing semicolons
OrfeasLitos Jun 1, 2018
699e09f
Remove redundant walletPlugin from node tests
OrfeasLitos Jun 3, 2018
9574b7b
Reinstall packages
OrfeasLitos Jun 3, 2018
f6528bb
Update to latest sinon version
OrfeasLitos Jun 8, 2018
6ef35c5
Add circulateCoins() for deduplication
OrfeasLitos Jun 8, 2018
f480c83
Use circulateCoins() for miner to miner
OrfeasLitos Jun 8, 2018
fa74665
Use {before,after}Each for addTX() spy
OrfeasLitos Jun 8, 2018
30367a6
Check call count of miner's addTX(), not prototype
OrfeasLitos Jun 8, 2018
867e791
Add sinon spy minimal testcase
OrfeasLitos Jun 10, 2018
4b4760c
Add spv tx circulation minimal testcase
OrfeasLitos Jun 10, 2018
b67e0dd
Add multisig/p2pkh tx to wallet minimal testcase
OrfeasLitos Jun 10, 2018
ea4ebc3
Simplify tx circulation minimal testcase
OrfeasLitos Jun 26, 2018
ca2c4bc
Complete spy minimal testcase
OrfeasLitos Jun 26, 2018
f83958d
Register addTX() on tx event separately
OrfeasLitos Jun 26, 2018
8babcab
Complete spv tx circulation minimal testcase
OrfeasLitos Jul 1, 2018
329a9e2
Keep waiting for tx signal as comment
OrfeasLitos Jul 1, 2018
b13007a
Modularize tx circulation tests
OrfeasLitos Jul 1, 2018
bb48885
Add mocha test timeout again
OrfeasLitos Jul 1, 2018
fd717ed
Add minimal testcase for multisig tx circulation
OrfeasLitos Jul 5, 2018
65e3547
Update mocha for security
OrfeasLitos Jul 14, 2018
6844eaf
Update package-lock.json due to install
OrfeasLitos Jul 14, 2018
91b7418
Update tag verification
OrfeasLitos Jul 14, 2018
bf46954
Update to new bcoin version
OrfeasLitos Jul 14, 2018
e26ce83
Change full,spv nodes' types to capitalized
OrfeasLitos Jul 15, 2018
b760f21
Capitalize Script, Network
OrfeasLitos Jul 15, 2018
4a5b195
Use bcrypto Hash160 and secp256k1
OrfeasLitos Jul 15, 2018
f9835e2
Use node.require("walletdb").wdb
OrfeasLitos Jul 15, 2018
3793324
Update multisig_tx minimal testcase for new bcoin
OrfeasLitos Jul 16, 2018
a6db5e0
Use wdb the new way
OrfeasLitos Jul 17, 2018
d1eece6
Add port for wallet
OrfeasLitos Jul 17, 2018
ba86707
Use internal WalletDB instead of plugin
OrfeasLitos Jul 18, 2018
429a287
Use default account the new way
OrfeasLitos Jul 20, 2018
732f9e7
Use script and hash160 the new way
OrfeasLitos Jul 20, 2018
4b3d5cb
Remove redundant wallet port
OrfeasLitos Jul 20, 2018
67faf22
Debug bcoin node handshake packet reject
OrfeasLitos Jul 24, 2018
c1d7a04
Add missing let
OrfeasLitos Jul 24, 2018
6f21f9f
Remove console.log()s
OrfeasLitos Jul 24, 2018
9991ebc
Rebuild modules
OrfeasLitos Jul 24, 2018
6ea9a85
Attempt to connect nodes by hand
OrfeasLitos Aug 1, 2018
cf9a4e0
Connect two nodes cleanly
OrfeasLitos Aug 2, 2018
a393ff1
Simplify require() for NetAddress
OrfeasLitos Aug 4, 2018
78c3dcf
Comment out walletPlugin
OrfeasLitos Aug 7, 2018
9e447e1
Add local nodes connect testcases
OrfeasLitos Aug 25, 2018
ede96a5
Use native walletDB
OrfeasLitos Aug 26, 2018
56808e3
Fix bloom filter test
OrfeasLitos Sep 4, 2018
e32848e
Fix full node addTX() test
OrfeasLitos Sep 9, 2018
bab2912
Add regression test for NodeClient.setFilter()
OrfeasLitos Oct 7, 2018
de7e5a4
Add isAllZeroes(buffer) to testHelpers
OrfeasLitos Oct 7, 2018
f5cec47
Add template for spv tests
OrfeasLitos Oct 7, 2018
830dc5a
Add test for account address in bloom filter
OrfeasLitos Oct 8, 2018
1e2a635
Add address to filter
OrfeasLitos Oct 8, 2018
63a83ec
Fix spv tx circulation test
OrfeasLitos Oct 8, 2018
54872b5
Add example with keyring manipulation
OrfeasLitos Oct 10, 2018
38f756c
Make keyring example more robust
OrfeasLitos Oct 11, 2018
c856b3f
Have P2PKHOUtput() accept Address objects
OrfeasLitos Oct 15, 2018
811bc62
Update npm installs
OrfeasLitos Oct 17, 2018
4464140
Add testcase for no multisig addition to wallet
OrfeasLitos Oct 23, 2018
28422ff
Attempt to waitForTX() through TIR
OrfeasLitos Nov 1, 2018
fd04d7a
Lint
OrfeasLitos Nov 6, 2018
13ac321
Check that wallet is of class Wallet
OrfeasLitos Nov 6, 2018
01d5e96
Initialize properly Trust node
OrfeasLitos Nov 6, 2018
c1367f6
Increase test timeout to 30000ms
OrfeasLitos Nov 11, 2018
0682f81
Export and use tag more cleanly
OrfeasLitos Nov 11, 2018
78489a4
Let wdb know that it is spv
OrfeasLitos Nov 11, 2018
ecb16a8
Add tag to spvFilter after opening wdb
OrfeasLitos Nov 11, 2018
2732e78
Update TODOs
OrfeasLitos Nov 11, 2018
5d8449b
Comment out part of testHelpers.waitForTX()
OrfeasLitos Nov 11, 2018
8b2e20c
Update node.js version
OrfeasLitos Nov 13, 2018
347321d
Change tag to master HD key
OrfeasLitos Jan 10, 2019
fc57628
Update partly full node test for [email protected]
OrfeasLitos Jan 10, 2019
be555d2
Add example of keyring generation from HD path
OrfeasLitos Feb 9, 2019
54d6e08
Update
OrfeasLitos Feb 9, 2019
e0fa45c
Update full node
OrfeasLitos Feb 10, 2019
0211eef
Increase test time
OrfeasLitos Feb 10, 2019
29ccd7b
Update spv test for latest bcoin
OrfeasLitos Feb 10, 2019
785bdf4
Use Promise.all
OrfeasLitos Feb 10, 2019
c465391
Dedup code by unifying {miner,spv}Wallets
OrfeasLitos Feb 10, 2019
a011229
Wait for TX gracefully
OrfeasLitos Feb 11, 2019
2d5812f
Remove dead function
OrfeasLitos Feb 11, 2019
ad14a40
Implement and use WalletWatcher
OrfeasLitos Feb 11, 2019
3dafa5a
Create tag instead of hardcoding
OrfeasLitos Feb 13, 2019
037cb00
Remove python tag generator
OrfeasLitos Feb 14, 2019
6e05718
Test that tag matches the expected public key
OrfeasLitos Feb 14, 2019
3797548
Update deps and fix ensuing issues
OrfeasLitos Jan 3, 2021
a9fec53
Attempt to connect nodes unsuccessfully
OrfeasLitos Jan 7, 2021
0a79bf0
Skip tests that need nodes connecting
OrfeasLitos Jan 7, 2021
2ad2d08
Postinstall hook: Use modified tx.js, txdb.js
OrfeasLitos Jan 24, 2021
8d6afe1
Update nodejs version in .travis.yml
OrfeasLitos Jan 24, 2021
a63f36c
flow: Ignore scripts/ directory
OrfeasLitos Jan 24, 2021
b969dda
Update packages
OrfeasLitos May 17, 2023
8ac2a12
Fix vulnerabilities automatically
OrfeasLitos May 17, 2023
5ee8448
Update from babel-eslint to @babel/eslint-parser
OrfeasLitos May 17, 2023
347adcb
Remove wallets when done
OrfeasLitos Jun 5, 2023
738388b
Update
OrfeasLitos Aug 21, 2023
31e8e6a
Update
OrfeasLitos Nov 7, 2023
7480202
Update
OrfeasLitos Nov 14, 2023
4b92a15
Start working on making spv work
OrfeasLitos Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"parser": "@babel/eslint-parser",
"plugins": [
"eslint-plugin-flowtype"
],
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:flowtype/recommended"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"flowtype/space-before-type-colon": 0,
"no-undef": 0,
"no-unused-vars": 0,
"no-console": 0
},
"settings": {
"flowtype": {
"onlyFilesWithFlowAnnotation": true
}
}
}
3 changes: 3 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[ignore]
.*/node_modules/*
.*/test/*
.*/minimal_testcases/*
.*/lib/*
.*/scripts/*

[include]
./src
Expand All @@ -10,3 +12,4 @@

[options]
all=true
unsafe.enable_getters_and_setters=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
lib/
*.swp
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: node_js
node_js:
- "15"

install:
- npm install
script:
- npm run check
Loading