Commit graph

3373 commits

Author SHA1 Message Date
Roy Lee
ccaa6dd816 [lbry] claimtrie: import current snapshot
Sync to tip

Co-authored-by: Brannon King <countprimes@gmail.com>
2021-07-08 10:41:12 -07:00
Roy Lee
2dcdb458e8 [lbry] blockchain: connect to ClaimTrie
Co-authored-by: Brannon King <countprimes@gmail.com>
2021-07-08 10:41:12 -07:00
Roy Lee
56c21c6bd6 [lbry] FIXME: remove the tests for now to pass CI.
Some test files failed to build as the go module "replace" doesn't work
with test and internal packages yet.

The other tests need updates to the testdata.
2021-07-08 10:31:56 -07:00
Roy Lee
87c3243bf1 [lbry] chaincfg: add chckpoint at block 946,000 2021-07-08 10:31:56 -07:00
Brannon King
4e68d1fb81 [lbry] log: support claimtrie entries 2021-07-08 10:31:56 -07:00
Roy Lee
b0f1458ff7 [lbry] misc: change RPC port from 8334 to 9245 2021-07-08 10:31:56 -07:00
Roy Lee
e0b451a76a [lbry] txscript: recognize LBRY claim script OPCODES 2021-07-08 10:31:56 -07:00
Roy Lee
57b3f96f3f [lbry] txscript: initial porting of claim script
Co-authored-by: Brannon King <countprimes@gmail.com>
2021-07-08 10:31:56 -07:00
Roy Lee
c4a5ae339c [lbry] txscript: change MaxScriptSize from 10,000 to 20,005 2021-07-08 10:31:56 -07:00
Roy Lee
ced137f9e2 [lbry] server: update client version to /btcwire:0.5.0/LBRY.GO:0.12.2/
TODO: double check if lbryd bumps the version.
2021-07-08 10:31:56 -07:00
Roy Lee
fc77c6db6a [lbry] blockchain, mempool: validate txscripts 2021-07-08 10:31:56 -07:00
Roy Lee
9b1c4fbc04 [lbry] blockchain: change Block Subsidy algorithm 2021-07-08 10:31:56 -07:00
Roy Lee
818ad52cdf [lbry] blockchain: change the difficulty adjustment algorithm.
adjusted := target + (actual - target) / 8

  max := target + (target / 2)
  min := target - (target / 8)

  if adjusted > max {
    adjusted = max
  } else if adj < min {
    adjusted = min
  }

  diffculty := lastDifficulty * adjusted / target

TODO & FIXME:

  btcd allows user to config the algorithm parameters.
  We'll update those config / commandline accordingly.

  Testnet settings are ignored here, will fix it later.
2021-07-08 10:31:56 -07:00
Roy Lee
35eaa76e42 [lbry] blockchain: make UTXO in Genesis block spendable 2021-07-08 10:31:56 -07:00
Roy Lee
42793ad871 [lbry] blockchain, txscript: change maxScriptElementSize from 520 t0 20,000 bytes 2021-07-08 10:31:56 -07:00
Roy Lee
f6450deacb [lbry] blockchain, wire: verify blockheaders using LBRY PoW 2021-07-08 10:31:56 -07:00
Roy Lee
3b9d3ab05f [lbry] blockchain: change max block size to 2,000,000 2021-07-08 10:31:56 -07:00
Roy Lee
c84ced2f10 [lbry] wire: update protocol NetIDs 2021-07-08 10:31:56 -07:00
Roy Lee
34bdf58303 [lbry] chaincfg: update chainparams for LBRY chain
Co-authored-by: Brannon King <countprimes@gmail.com>
Co-authored-by: Alex Grintsvayg <grin@lbry.com>
2021-07-08 10:31:56 -07:00
Roy Lee
3cf16aad88 [lbry] chaincfg: setup genisis blocks 2021-07-08 10:31:56 -07:00
Roy Lee
be9fc27e6f [lbry] chaincfg: implement LBRY PoW Hash 2021-07-08 10:31:56 -07:00
Roy Lee
e62432dc95 [lbry] add ClaimTrie to Block Header 2021-07-08 10:31:56 -07:00
Roy Lee
0636c889f5 [lbry] misc: rename btc{d,ctl,wallet} chain{d,ctl,wallet}
Currently, we only change the places where they impact runtime.
Mostly are filenames or paths for executables and databases.

Docs and other textual changes will be updated later to reduce
conflicts when we rebase.

rename
2021-07-08 09:47:25 -07:00
Mark Beamer Jr
4f422e29cf [lbry] rpcclient: Allow any chain params not specified in repo already. 2021-07-06 20:23:29 -07:00
Brannon King
363cc18b31 profile: support fgprof (flame graph) 2021-07-06 20:14:31 -07:00
Brannon King
860529321f wire: optimize binaryFreeList handling 2021-07-06 20:12:49 -07:00
Roy Lee
43566e6f2b gitignore: ignore IDE stuff 2021-07-06 20:10:38 -07:00
Roy Lee
7ae6608f48 ci: Update Go toolchain to 1.16 2021-07-06 20:10:38 -07:00
Anirudha Bose
63438c6d36 Update release date for v0.22.0-beta in CHANGES file 2021-06-01 13:16:51 -04:00
John C. Vernaleo
aaf19b26f3 btcd: bump version to v0.22.0-beta 2021-06-01 09:36:33 -04:00
Anirudha Bose
418f9204f4 Update CHANGES file for 0.22.0 release 2021-05-26 09:54:22 -04:00
Olaoluwa Osuntokun
ee5896bad5 mempool: add additional test case for inherited RBF replacement
In this commit, we add an additional test case for inherited RBF
replacement. This test case asserts that if a parent is marked as being
replaceable, but the child isn't, then the child can still be replaced
as according to BIP 125 it shoudl _inhreit_ the replaceability of its
parent.

The addition of this test case was prompted by the recently discovered
Bitcoin Core "CVE" [1]. It turns out that bitcoind doesn't properly
implement BIP 125. Namely it fails to allow a child to "inherit"
replaceability if its parent is also replaceable. Our implementation
makes this trait rather explicit due to its recursive implementation.
Kudos to the original implementer @wpaulino for getting this correct.

[1]: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-May/018893.html.
2021-05-13 10:15:27 -04:00
Oliver Gugger
7b6c2b3423 chaincfg: fix deployment bit numbers
On signet all previous soft forks and also taproot are always activated,
meaning the version is always 0x20000000 for all blocks. To make sure
they activate properly in `btcd` we therefore need to use the correct
bit to mask the version.
This means that on any custom signet there would need to be 2016 blocks
mined before SegWit or Taproot can be used.
2021-05-11 15:55:06 -04:00
John C. Vernaleo
0ec4bdc1b8 Don't reference the readme that we don't produce 2021-05-06 18:51:45 -04:00
Olaoluwa Osuntokun
ce697fe7e8
Merge pull request #1716 from halseth/witness-commitment-rpctest
rpctest: add witness commitment when calling CreateBlock
2021-04-29 15:55:35 -07:00
Olaoluwa Osuntokun
7eba688b65
Merge pull request #1692 from guggero/signet
wire+chaincfg: add signet params
2021-04-26 11:01:13 -07:00
Johan T. Halseth
37a6e8485b
rpctest: add witness commitment when calling CreateBlock
If we tried to include transactions having witnesses, the block would be
invalid since the witness commitment was not added.
2021-04-26 13:53:53 +02:00
Johan T. Halseth
f0f4784c1c
mining: extract witness commitment add into method 2021-04-26 13:53:22 +02:00
Oliver Gugger
7d1ab0b4d7
btcctl: add signet param
This commit adds the --signet command line flag to the btcctl utility.
2021-04-22 13:10:45 +02:00
Oliver Gugger
8a62cf0ef5
rpcserver: add taproot deployment to getblockchaininfo 2021-04-22 13:10:45 +02:00
Oliver Gugger
3eac153437
config+params: add signet config option
This commit adds the --signet command line flag (or signet config
option) for starting btcd in signet mode.
2021-04-22 13:10:45 +02:00
Oliver Gugger
73ecb5997b
wire+chaincfg: add signet params
This commit adds all necessary chain parameters for connecting to the
public signet network.
Reference: https://github.com/bitcoin/bitcoin/pull/18267
2021-04-22 13:10:44 +02:00
Aurèle Oulès
2d7825cf70 btcjson: Updated TxRawResult.Version from int32 to uint32 2021-04-13 15:21:09 -04:00
Jake Sylvestre
540786fda6 rpcclient: fix documentation typo 2021-04-13 09:09:20 -04:00
Olaoluwa Osuntokun
36a96f6a00
Merge pull request #1704 from wpaulino/update-btcutil
build: update btcutil dependency
2021-03-31 18:33:23 -07:00
Wilmer Paulino
f133593b93
build: update btcutil dependency 2021-03-29 16:59:44 -07:00
Gustavo Chain
f86ae60936 addrmgr: Use RLock/RUnlock when possible 2021-03-16 13:24:10 -04:00
Olaoluwa Osuntokun
01c6a6fe9b
Merge pull request #1698 from wpaulino/external-peer-testing
peer: allow external testing of peer.Peer
2021-03-12 16:28:45 -08:00
Wilmer Paulino
fdb479f121
peer: allow external testing of peer.Peer
The previous use of allowSelfConns prevented this, as users aren't able
to invoke peer.TstAllowSelfConns themselves due to being part of a test
file, which aren't exported at the library level, leading to a
"disconnecting peer connected to self" error upon establishing a mock
connection between two peers. By including the option at the config
level instead (false by default, prevents connections to self) we enable
users of the peer library to properly test the behavior of the peer.Peer
struct externally.
2021-03-11 18:24:13 -08:00
Gustavo Chain
556620fea6 rpcserver: Fix Error message returned by processRequest
When processRequest can't find a rpc command, standardCmdResult returns
a `btcjson.ErrRPCMethodNotFound` but it gets ignored and a
`btcjson.ErrRPCInvalidRequest` is returned instead.

This makes processRequest return the right error message.
2021-03-09 10:34:32 -05:00