Commit graph

2895 commits

Author SHA1 Message Date
pedro martelletto
9809f4ffdd Instrument basic logging 2018-05-23 16:46:15 -07:00
pedro martelletto
cf74c8c3ca Abstract filter generation to a separate function 2018-05-23 16:46:15 -07:00
pedro martelletto
05d2fdeb11 Rename a variable in CBF's ConnectBlock() 2018-05-23 16:46:15 -07:00
pedro martelletto
620ad5b6fb Store filter in a db block index 2018-05-23 16:46:15 -07:00
pedro martelletto
b2990e7999 Move filter generating code to CBF indexer 2018-05-23 16:46:15 -07:00
pedro martelletto
95cbe2a911 Add the skeleton of a CBF indexer 2018-05-23 16:46:15 -07:00
pedro martelletto
c8627cbee4 Use a harcoded key to generate filters
Pointed out by alex@. Using a dummy key for now.
2018-05-23 16:46:15 -07:00
pedro martelletto
dc25da8296 Generate a filter for a given block 2018-05-23 16:46:15 -07:00
pedro martelletto
e9298934b9 Add a stub GetCBFilter message.
Actual semantic and payload format yet to be defined.
2018-05-23 16:46:15 -07:00
pedro martelletto
333af136ef Create a knob to switch CBFs off.
While having them on by default. We may want to revisit this and
make no CBFs the default.
2018-05-23 16:46:15 -07:00
pedro martelletto
d82e76cec9 Introduce a service flag for CBFs.
Add a service flag for CBFs in the wire protocol.
2018-05-23 16:46:15 -07:00
Olaoluwa Osuntokun
1432d294a5 build: update glide to point to latest btcutil
In this commit, we update the glide.lock file to be pinned against the
latest btcutil commit hash. btcutil has recently been updated to pull in
all changes from roasbeef's fork. Notably, it now includes the code
necessary for creating GCS filters (BIP 158).
2018-05-15 21:01:05 -07:00
Olaoluwa Osuntokun
4b968f7e18 btcec: remove obsolete test 2018-05-15 20:47:29 -07:00
Olaoluwa Osuntokun
2842f933bb server: fix linter error 2018-05-15 20:47:29 -07:00
Olaoluwa Osuntokun
04f0b5338a build: switch to stable version of gometalinter 2018-05-15 20:47:29 -07:00
Olaoluwa Osuntokun
253b37c17f btcec: format btcec_test.go with gofmt -s 2018-05-15 20:47:29 -07:00
Olaoluwa Osuntokun
7580169cb6 build: update build to use go 1.9.5 and 1.10.1 2018-05-15 20:47:29 -07:00
Vadym Popov
675abc5df3 chaincfg: change hrp prefix for regtest network 2018-04-17 20:01:12 -07:00
Dave Collins
2be2f12b35 rpcclient: Update for go1.10 breaking changes.
Go 1.10 made some changes such that json.Unmarshal can no longer
unmarshal into exported fields that are themselves embedded via an
uninitialized unexported pointer.

Since rpcclient previously relied on this behavior, this updates the
client to create the pointers before unmarshalling into the struct.
2018-02-19 18:56:35 -06:00
Josh Rickmar
1cd648d784 Require atomic swap contracts to specify the secret size.
This allows redeeming parties to audit the secret size and ensure it
will be usable once revealed.
2018-02-16 16:18:43 -05:00
Kai
9866016012 Fix sub packages links 2018-02-13 13:36:48 -06:00
benma
99a26bf7e0 wire: typo in BlockHeader PrevBlock comment 2018-02-13 13:04:12 -06:00
Jim Posen
0ef0d8c59b blockchain: Initialize database with genesis block.
This fixes a bug introduced by #1066.
2018-02-09 11:34:30 -05:00
Alex Manuskin
50de9da05b blockchain: Fix typo in example_test.go. 2018-01-31 02:40:46 -06:00
Jim Posen
9aa9e79ebf blockchain: Enhance migration to v2 block index bucket.
This updates the block index migration to also store entries with
valid status bytes.
2018-01-28 23:34:56 -06:00
Jim Posen
52cddc19cd blockchain: Persist block status changes to disk.
The block index now tracks the set of dirty block nodes with status
changes that haven't been persisted and flushes the changes to the DB
at the appropriate times.
2018-01-28 23:34:56 -06:00
Jim Posen
31444f5890 blockchain: Add parent to blockNode constructor. 2018-01-28 23:34:56 -06:00
Jim Posen
a4d22d8384 blockchain: Delete block headers from old block index bucket.
As part of the migration to the new block index bucket, also delete
the redundant data from the old bucket.
2018-01-28 23:34:56 -06:00
Jim Posen
ad00e7ff82 database: Stop writing block header data to LevelDB.
Now that all headers are stored in the in-memory index, the database
bucket managed by blockchain, and in the flat files, it makes sense to
drop the redundant data from the block index bucket in ffldb.

To avoid modifying the database interface, this reimplements
FetchBlockHeader(s) to use header data stored in flat files. This can
be trivially implemented by delegating to FetchBlockRegion.
2018-01-28 23:34:56 -06:00
Jim Posen
74fb6e56da blockchain: Database migration to populate block index bucket.
This creates a migration function that populates the block index
bucket using data from the ffldb block index bucket if it does not
exist.
2018-01-28 23:34:56 -06:00
Jim Posen
6315cea70c blockchain: Load all block headers into block index on init.
Currently only the blocks in the active chain are loaded into the
block index on initialization. This instead iterates over the entire
block index bucket in LevelDB and loads all nodes.
2018-01-28 23:34:56 -06:00
Jim Posen
175fd940bb blockchain: Store block headers in bucket managed by chainio.
The bucket contains block headers keyed by the block height encoded as
big-endian concatenated with the block hash. This allows block headers
to be fetched from the DB in height order with a cursor.
2018-01-28 23:34:56 -06:00
Cédric Félizard
358aed20b7 sampleconfig: Remove duplicate setting.
`addrindex` was present twice.
2018-01-28 23:25:43 -06:00
Jeremiah Goyette
fe786c93b6 rpcclient: implement addwitnessaddress 2018-01-26 01:20:40 -06:00
nakagawa
e4a6228752 rpcclient: Add decodescript support. 2018-01-26 00:20:33 -06:00
Nicola 'tekNico' Larosa
11fcd83963 btcd/multi: fix a number of typos in comments. 2018-01-25 23:23:59 -06:00
Marko Bencun
16dbb2602a txscript: export calcSignatureHash
This is a useful function for users of this library, and deserves to
be public.
2018-01-25 23:14:55 -06:00
Leonardo Lazzaro
78d12c33f0 database: Update rpcclient link in README.md. 2018-01-25 22:43:53 -06:00
Mitchell Paull
f22a07b6cf blockchain: Fix typos in README.md. 2018-01-25 22:40:42 -06:00
Kamil Slowikowski
be04ac2370 rpcserver: Fix typo in generate handler.
"mine a block" instead of "main a block".
2018-01-25 22:39:33 -06:00
Shuai Qi
b6afec5e51 txscript: Fix comment typo. 2018-01-25 22:37:50 -06:00
Josh Rickmar
2e60448ffc txscript: Require SHA256 secret hashes for atomic swaps 2017-11-28 10:07:13 -05:00
Janus Troelsen
8cea3866d0 Update script_test.go
Typo fix
2017-10-26 14:26:30 +02:00
Jim Posen
c7588cbf76 blockchain: NodeStatus & Set/UnsetStatusFlags methods on blockIndex.
These method allows safe concurrent access to reading and modifying
block node statuses. When block statuses get persisted in a later
change, the setter methods can be used to mark block nodes as dirty.
2017-10-23 04:33:15 -05:00
Jim Posen
e1ef2f899b blockchain: Track block validation status in block index.
Each node in the block index records some flags about its validation
state. This is just stored in memory for now, but can save effort if
attempting to reconnect a block that failed validation or was
disconnected.
2017-10-23 04:33:15 -05:00
Jim Posen
11d7cae82b rpctest: Compile current version of btcd and run that.
Previously, rpctest would start a btcd node using the btcd executable
in the environment PATH. This caused difficult-to-find issues where
the code would be tested against an older version of btcd, or another
fork entirely. Now it compiles btcd the first time it is needed and
uses that fresh version when launching nodes.
2017-10-20 14:29:45 -07:00
Steven Roose
fb43a179cb btcec: Add case to signature serialization test
It adds the case where the S value of the signature is bigger than the
half of the order of the curve.
2017-10-13 03:37:29 -05:00
Steven Roose
79445fbd97 btcec: Prevent static initialization of S256
This is achieved by introducing a new variable `halfOrder` on the
KoblitzCurve struct that is half the order.
2017-10-13 03:37:29 -05:00
Jim Posen
64d60f2ef2 blockchain: Remove BFDryRun behaviour flag.
This was only used to test block proposals, which has been changed to
instead use CheckConnectBlockTemplate. The flag complicated the
implementation of some chain processing routines and would be
difficult to implement with headers-first syncing.
2017-10-12 06:07:46 -05:00
Jim Posen
04444c1d0e blockchain: Use CheckConnectBlockTemplate for RPC block proposals.
This renames CheckConnectBlock to CheckConnectBlockTemplate and
modifies it to be easily consumable by the getblocktemplate RPC
handler. Performs full block validation now instead of partial
validation.
2017-10-12 06:07:46 -05:00