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

Support upcoming DCP-0006 changes #7

Merged
merged 18 commits into from
Oct 7, 2020
Merged

Conversation

matheusd
Copy link
Member

@matheusd matheusd commented Oct 1, 2020

Rebased on top of #6

This adds support on dcrros for identifying and handling the new transaction types introduced by DCP-0006: treasury base, add and spend transactions.

Assuming DCP-0006 passes, the treasury funds will now be handled as a special treasury account state by the consensus rules, instead of using the standard utxo model. This means these funds won't live in a standard output/address, which has implications for how balances are tracked in dcrros.

This PR changes the block processing functions to identify the treasury transactions and account for treasury funds in a hard-coded TreasuryAccountAddress, currently set to "*treasury".

Since that version removed http logging, a custom request logger is
introduced.
This moves the script_version attribute from the operation into the
account metadata where it more naturally belongs. This eases parsing and
makes it less likely to use the wrong script version along with an
account.
This makes it so that the config file can specify the data and log dirs.
This makes the error point to the correct height.
This adds initial support for treasurybases for the new treasury work.
This changed the representation of accounts for some of the construction
API types.
This changes the internal Op to carry the txhash of the transaction to
avoid having to recalculate it repeatedly.
This switches the Rosetta implementation to fill the CoinChange
information in blocks.
This switches the conversion from Rosetta to Decred transactions to read
prevout information from metadata to the recently introduced CoinChange
field in operations.
This modifies the tests for the block related functions to assert the
generated CoinChange field is correct.
This modifies the /construct/metadata endpoint to return a fee
estimation for the passed transaction.

This is required so that clients can correctly build a valid tx.
This empties the operation's status field during a call to
/construct/preprocess.

This is needed because the check:construct rosetta-cli test expects
empty status on this endpoint.
This changes the CombineTxSigs function so that input signatures assumed
to be in the compact format are converted into the proper DER-encoded
signatures that can redeem P2PKH outputs.
This adds a sample rosetta-cli config file that is usable for simnet
runs of dcrros plus a sample dcrros config file that is usable with the
standard dcrd/contrib/dcr_tmux_simnet_setup.sh environment.
This adds support to converting treasury txs (tbases, tadds and tspends)
to Rosetta.

The treasury account is represented by a special hard-coded address that
does not correspond to any valid, standard v0 script addresses.
The treasury balance is tracked by a special account, identified in
dcrros as "*treasury". This changes the /account/balance implementation
to return the correct balance when that account is requested.
types/block.go Show resolved Hide resolved
@matheusd matheusd merged commit c04232a into decred:master Oct 7, 2020
@matheusd matheusd deleted the treasury branch October 7, 2020 18:29
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.

2 participants