Commit Graph

1031 Commits

Author SHA1 Message Date
Nadav Ivgi
49cf7a7dff
Fetch feerate estimates for confirmation targets of 5 and 25 blocks
Electrum is asking for these confirmation targets and fails if they're missing.

01fc048484/electrum/simple_config.py (L21)
2019-12-16 02:30:11 +02:00
Nadav Ivgi
0b42e8271f
Add explicit dyn 2019-12-04 10:24:32 +02:00
Nadav Ivgi
6adda1bd51
electrum: Limit the number of txs returned per query
The electrum protocol does not support paging, which makes this a potential DoS
vector if no limit is set.

The limit is configurable via --electrum-txs-limit and defaults to 100.

A similar change was made in upstream electrs:
e1825fdc77
2019-12-04 05:42:25 +02:00
Nadav Ivgi
fdb33e5c84
Run cargo fmt 2019-11-08 02:45:31 +02:00
Lawrence Nahum
b283ab8783
update popular address pre-cache 2019-11-06 18:36:39 +01:00
Nadav Ivgi
18ce4f0359
Use 4k as the cutoff point for popular scripts
This is what was used previously
2019-11-06 19:33:16 +02:00
Nadav Ivgi
809c87a16c
Only print out popular scripts with >=5k entries 2019-11-06 19:11:26 +02:00
Nadav Ivgi
914d17357f
Print out popular scripts in the same format expected for processing 2019-11-06 19:10:48 +02:00
Nadav Ivgi
f4930d6d94
Treat asset/token amounts of null as zero
Followup to 395cd746d5, this is another place where
the conversion to zero should be made.

It appears like the previous commit did not actually fix https://github.com/Blockstream/esplora/issues/146,
but this one hopefully should.
2019-11-06 18:18:48 +02:00
Nadav Ivgi
adb76ee65a
Remove outdated comment, reformat 2019-10-16 07:59:10 +03:00
Nadav Ivgi
32dfc38dc9
Update cargo crates: dirs, hex, lru prometheus and url
The rust-bitcoin crate was not updated because it conflicts
with the rust-bitcoin version used by the elements crate.
2019-10-16 07:58:01 +03:00
Nadav Ivgi
b0ca4d7824
Run cargo update 2019-10-16 05:16:26 +03:00
Nadav Ivgi
395cd746d5
Treat issuance amount of null as zero
Fixes https://github.com/Blockstream/esplora/issues/146

It appears like issuances of 0 asset units (like in [0] from #146) are encoded
as a null value rather than as an explicit value of zero, so we convert it to
a zero ourselves. This matches the behaviour of the re-issuance tokens, which
also represent zero tokens as a null value (which we already convert to zero).

[0] https://blockstream.info/liquid/tx/152a6bce79d49acfea3fc9f3c905f3580a646cbadea2f07fec93d9462d7d2731/
2019-10-11 19:08:44 +03:00
Nadav Ivgi
a786af56bd
Implement GET /block/:hash/txid/:index
To return the nth transaction within a certain block.

Refs https://github.com/Blockstream/esplora/issues/141
2019-08-29 03:36:14 +03:00
Nadav Ivgi
eaf03a3a3e Add API support for the native token asset
Assets are now represented with a wrapper enum that has two variants:
`LiquidAsset::Issued(IssuedAsset)` and `LiquidAsseT::Native(NativeAsset)`

The native asset is hardcoded to L-BTC.
2019-08-29 02:39:46 +03:00
Nadav Ivgi
d76169ad05 Correct comments 2019-08-29 02:38:12 +03:00
Steven Roose
6baa2beb7c
Manually format code to satisfy cargo fmt -- --check 2019-08-20 14:22:22 +01:00
Steven Roose
2ee8fdb07a
Update elements dep 2019-08-20 13:35:07 +01:00
Steven Roose
a0facf47d3
Update to rust-bitcoin v0.19.1 and related deps 2019-08-19 23:06:57 +01:00
Lawrence Nahum
1dd662d5b4
update hex and hyper 2019-08-19 18:29:15 +02:00
Andrew Toth
78517febb8 Skip processing when incomplete data is included in RAW block file 2019-07-06 20:22:32 +03:00
Nadav Ivgi
0a1af17f1c
Don't load block headers from the db
This was causing some unexpected behaviour and is turned off temporarily
until further inspection.

Blocks will be loaded from the bitcoind rpc instead, which is slower, but
should resolve the issue.
2019-07-05 11:37:37 +03:00
Nadav Ivgi
9c602d44c5 Switch to rust-bitcoin/bitcoin_hashes current master (PR was merged, but still not released in a version) 2019-06-29 03:51:22 +03:00
Nadav Ivgi
9206a635a0 Update API JSON format to match cpp-elements's naming convention
The issuance input JSON format was changed as following:

- Added a `contract_hash` field with the user-provided entropy of initial issuances.
  This field is not available for reissuances.

- Changed `asset_entropy` to contain the asset entropy derived from the user-provided
  entropy and the prevout. This only effects initial issuances.

Refs https://github.com/Blockstream/esplora/issues/99
2019-06-29 03:51:22 +03:00
Nadav Ivgi
168d3d6213 Support assets with an unconfirmed initial issuance
This allows looking up assets that haven't confirmed yet
and adds a new "status" field to assets with the confirmation
status of the issuance tx.
2019-06-29 03:51:22 +03:00
Nadav Ivgi
9e0739cc9d Asset indexing no longer requires the previous txos map
Plus some other dead code removal
2019-06-29 03:51:22 +03:00
Nadav Ivgi
ae20e33742 Keep asset history entries for issuances and burns only
Without tracking regular (unconfidential) funds/spends.

Following a discussion with Lawrence.
2019-06-29 03:51:22 +03:00
Nadav Ivgi
613dbec90f Cleanup transactions leaving the mempool from the mempool asset index 2019-06-29 03:51:22 +03:00
Nadav Ivgi
7ded6a016e Represent asset ids as sha256d more consistently
Should eventually be changed to use the more appropriate AssetId,
once that gets integrated into the mainline rust-elements,
2019-06-29 03:51:22 +03:00
Nadav Ivgi
9f6ead6616 Implement asset stats for mempool transactions index 2019-06-29 03:51:22 +03:00
Nadav Ivgi
36ae4a3fc8 Implement mempool transactions memory index
And update the REST interface to support querying mempool txs.
2019-06-29 03:51:22 +03:00
Nadav Ivgi
1a029ace81 Refactor asset indexing to separate core logic from db handling
In preparation of implementing mempool asset indexing with
less code duplication.
2019-06-29 03:51:22 +03:00
Nadav Ivgi
e4ca2c7eb0 Don't return empty contract hashes 2019-06-29 03:51:22 +03:00
Nadav Ivgi
4bb1b752f6 Run cargo fmt 2019-06-29 03:51:22 +03:00
Nadav Ivgi
5910402772 Rename AssetRowValue -> AssetRow, Issuance -> Issuing 2019-06-29 03:51:22 +03:00
Nadav Ivgi
449d47bad5 Keep track of reissuance tokens and their burns
This exposes two new asset stats fields: `reissuance_tokens` and `burned_reissuance_tokens`

Also, the asset id of the reissuance token is now available under the `reissuance_token` field of the asset.
2019-06-29 03:51:22 +03:00
Nadav Ivgi
55e46d211b Keep track of issued assets burns 2019-06-29 03:51:22 +03:00
Nadav Ivgi
758ad61c95 Replace issued_amount_known with its reversed form, has_blinded_issuances 2019-06-29 03:51:22 +03:00
Nadav Ivgi
8f3a393aa0 Implement asset stats tracking with delta updates 2019-06-29 03:51:22 +03:00
Nadav Ivgi
cec44c73bd Reverse asset_entropy to match the format used by elements-cp 2019-06-29 03:51:22 +03:00
Nadav Ivgi
5c850f102a Skip serializing empty Options 2019-06-29 03:51:22 +03:00
Nadav Ivgi
74848e7af3 Display contract_hash backwards, to match elements-cpp 2019-06-29 03:51:22 +03:00
Nadav Ivgi
9e89d7c935 Index reissuance transactions and determine their asset id 2019-06-29 03:51:22 +03:00
Nadav Ivgi
aad336f1d8 Move import to avoid warning in non-liquid mode 2019-06-29 03:51:22 +03:00
Nadav Ivgi
663e38f516 Keep just the contract_hash in AssetEntry, remove the AssetIssuance
This allows us to avoid the separate AssetValue struct, ind is all we typically need.
Users that want the full AssetIssuance details can request the issuance tx.
2019-06-29 03:51:22 +03:00
Nadav Ivgi
cd11122d92 Attach asset metadata from asset registry db 2019-06-29 03:51:22 +03:00
Nadav Ivgi
8656ea6b5d Move elements-related code to src/elements/ 2019-06-29 03:51:22 +03:00
Nadav Ivgi
0de07570b7 Add querying abilities to the new asset index
Exposed over the HTTP REST API as two new endpoints:
GET /asset/:asset_id and GET /asset/:asset_id/txs
2019-06-29 03:51:22 +03:00
Nadav Ivgi
39b4030f07 Add indexes for asset issuances and non-blinded funding/spending txs
Currently for on-chain txs only (no mempool support) and with no querying ability yet
2019-06-29 03:51:22 +03:00
Nadav Ivgi
3a09759e19 Attach issued asset id to issuance inputs
Unimplemented for re-issuance transactions.

Depends on an umerged PR to bitcoin_hashes (ttps://github.com/rust-bitcoin/bitcoin_hashes/pull/39)
2019-06-29 03:51:22 +03:00