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

Add irregular txType, add check for total balance, prevent proposal withhold attack #2587

Merged

Conversation

ManfredKarrer
Copy link
Contributor

No description provided.

We don't want to burn BSQ in cases like that the tx was published too
late, which is a valid case if the tx does not make it in the next block.
We set such txs as IRREGULAR and allow spending of the BSQ, but there
function in the governance is invalidated.

We also add a check if the sum of all UTXO is the same as the sum of the
genesis + sum of issuance txs - burned fees.
@ManfredKarrer ManfredKarrer added this to the v0.9.6 milestone Mar 26, 2019
@ManfredKarrer ManfredKarrer requested a review from sqrrm March 26, 2019 05:38
# Conflicts:
#	desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java
@ManfredKarrer ManfredKarrer changed the title Add check for bsq balance Add irregular txType, add check for total balance Mar 26, 2019
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

I have some suggested changes that you can use if you feel like.

There is also some questions on how lenient we should be with irregular txs for failed issuance, just added my thoughts.

Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

ManfredKarrer and others added 6 commits March 27, 2019 12:27
# Conflicts:
#	core/src/main/resources/i18n/displayStrings.properties
#	desktop/src/main/java/bisq/desktop/main/dao/wallet/dashboard/BsqDashboardView.java
We did not update the merit correctly in case there was no proposal
selected.
In case of an invalid tx we burn all available BSQ input. We only know
that at parsing time. We renamed the burntFee field to burntBsq to make
it more generic and use it for the burnt fee in case if a normal tx and
as invalidatedBsq in case of an invalid tx.
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

I think changing the name to burntBsq made it a lot easier to read and understand. Looks like a good solution.

- Check max length of strings and byte arrays
- Check that tx ID has 64 chars
- Add ExtraDataMapValidator for validating extraDataMap fields
- It is more safe to separate the BTC_DAO_TESTNET and BTC_DAO_REGTEST
by the network ID as that prevents on the P2P network layer that the
network could interconnect. We would have risked that we receive network
data from the other network as users would use the persisted peers for
connections.
# Conflicts:
#	core/src/main/resources/i18n/displayStrings_de.properties
#	core/src/main/resources/i18n/displayStrings_el.properties
#	core/src/main/resources/i18n/displayStrings_es.properties
#	core/src/main/resources/i18n/displayStrings_fa.properties
#	core/src/main/resources/i18n/displayStrings_fr.properties
#	core/src/main/resources/i18n/displayStrings_hu.properties
#	core/src/main/resources/i18n/displayStrings_pt.properties
#	core/src/main/resources/i18n/displayStrings_ro.properties
#	core/src/main/resources/i18n/displayStrings_ru.properties
#	core/src/main/resources/i18n/displayStrings_sr.properties
#	core/src/main/resources/i18n/displayStrings_th.properties
#	core/src/main/resources/i18n/displayStrings_vi.properties
#	core/src/main/resources/i18n/displayStrings_zh.properties
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ManfredKarrer ManfredKarrer marked this pull request as ready for review March 31, 2019 22:43
@ManfredKarrer ManfredKarrer requested a review from ripcurlx as a code owner March 31, 2019 22:43
@ManfredKarrer
Copy link
Contributor Author

Last commits have been rather trivial, but you are welcome to review them post merge as well.

@ManfredKarrer ManfredKarrer requested a review from cbeams as a code owner March 31, 2019 22:54
@ManfredKarrer
Copy link
Contributor Author

ManfredKarrer commented Mar 31, 2019

Build error is prob caused due cache issue. Local build works and witness has not changed. Pushed anotehr change to trigger re-build.

@ManfredKarrer ManfredKarrer merged commit 3854907 into bisq-network:master Mar 31, 2019
@sqrrm
Copy link
Member

sqrrm commented Apr 1, 2019

Latest changes also look good.

@ManfredKarrer ManfredKarrer deleted the add-check-for-bsq-balance branch April 4, 2019 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants