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

BSQ trading fee calculated incorrectly #5329

Closed
ghost opened this issue Mar 18, 2021 · 3 comments · Fixed by #5552
Closed

BSQ trading fee calculated incorrectly #5329

ghost opened this issue Mar 18, 2021 · 3 comments · Fixed by #5552

Comments

@ghost
Copy link

ghost commented Mar 18, 2021

Some offers pay an incorrect BSQ fee.

Here is an example of the discrepancies from today's offer book. Some have underpaid, others have overpaid.

image

The fee rate is chosen based on the block height at the time the offer is created. For example, an offer created at block height 673810 would use the fee rate of 7.53 BSQ per bitcoin.

image

A small but significant subset of offers have not chosen the correct fee rate. How can this happen?

Looking at the highlighted onion addresses, it seems that when a node chooses an incorrect rate, it is consistent in choosing the same incorrect fee rate for subsequent offers.

Attn: @chimp1984 @ripcurlx
feeDiscrepancies_20210318.xlsx TxFeeRawData_20210318.txt

@chimp1984
Copy link
Contributor

It can be that the user has not a synced DAO state. There are quite some nodes with incorrect BSQ state hash (see DAO monitor in app). We should add some popup to enforce those users to resync DAO state.
You can try to click take offer for those users, then you are connected and at next block you likely get their DAO state and it shows up in the monitor if they have an invalid hash. That would a way how to detect if that is the reason (no guarantee though that u get their hash).

One way to handle that would be like we do for fee receiver address. If the value does not match the expected value we iterate over all past dao param values and if one of those matches we consider it valid. That covers the non-in-sync cases.
As it always can happen that a user gets out of sync, I assume there is no other way around.

@pazza83
Copy link

pazza83 commented Mar 20, 2021

It can be that the user has not a synced DAO state

How does a user know if their DAO state is correctly synced?

dao

I see this most times, are the seed nodes the same as the DAO state?

@chimp1984
Copy link
Contributor

If your node is in sync with the seed nodes all is ok.

The DAO state is a hash of the total data model data (all transactions and BSQ related data inculding voting and issuance data). So that is a way to quickly see if a node is out of sync for whatever reason. All nodes need to have the same hash at the same block. There could be theoretically a short period when there is BTC chain split and some nodes get the data from one chain and the others from the other chains block. But as soon the reorg happens in BTC and the network finds consensus again the BSQ hash must also converge to the same hash again.

If your node is not in sync with a seed node you get a red text and a button to make a DAO state resync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants