Bitcoin Forum
April 24, 2024, 05:57:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 [47] 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 »
  Print  
Author Topic: 300 BTC Coding Contest: Distributed Exchange (MasterCoin Developer Thread)  (Read 129133 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic.
grazcoin
Sr. Member
****
Offline Offline

Activity: 284
Merit: 250



View Profile
January 20, 2014, 07:58:48 AM
 #921

The guys from engine.co found a potential race condition where the user could accidentally create a new sell order when they were trying to change an old one, because the old one had already been bought.

At my suggestion, Marv made this pull request to add a 2-confirmation time limit after a sale is complete before that address can initiate a new sell offer: https://github.com/mastercoin-MSC/spec/pull/38

I'm posting here because not respecting the time limit will lead to consensus divergence, so I want to make sure everybody is aware of it.

Thanks!

Perhaps it's the lack of sleep but I don't like the fact that this has been merged already, up till now everything we did was democratic. Shouldn't we discuss such a major change in the protocol before merging it? I would appreciate it if at least some examples could be given in how this is suppose to work before and after the merge.

I also think this pull request should be open for discussion like any other pull request.
my opinion:
I don't think this solution really solves this race condition, e.g. due to difference in fee amount and inputs complexity of the buy/sell change transactions, the sell offer change can still get merged 2 confirmations later, and then we're in the same race condition state.

Alternative solution would be to keep only the option to cancel the offer (amount zero), and omit the option to change it.
If one wants to make a change, he can first cancel the old offer, and then create a new one.

EDIT: it would be also much easier to implement, and reduce complexity.


My plus 1 for this idea. Separate messages make a lot of sense to me.

any update on this? J.R.?
I would like to update the implementation.

1713981466
Hero Member
*
Offline Offline

Posts: 1713981466

View Profile Personal Message (Offline)

Ignore
1713981466
Reply with quote  #2

1713981466
Report to moderator
1713981466
Hero Member
*
Offline Offline

Posts: 1713981466

View Profile Personal Message (Offline)

Ignore
1713981466
Reply with quote  #2

1713981466
Report to moderator
In order to achieve higher forum ranks, you need both activity points and merit points.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713981466
Hero Member
*
Offline Offline

Posts: 1713981466

View Profile Personal Message (Offline)

Ignore
1713981466
Reply with quote  #2

1713981466
Report to moderator
jakecnn
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
January 20, 2014, 10:11:06 AM
 #922

Did you change something with sell offers, grazcoin? Because when I look at any of them now I see :

Transaction    {{transactionInformation.tx_hash}}
Sell offer details Seller    {{transactionInformation.from_address}}
Currency    {{transactionInformation.currency_str}}
Price per coin    {{transactionInformation.formatted_price_per_coin}} ฿/{{currency}}
Amount for sell    {{transactionInformation.formatted_amount}}
Amount available    {{transactionInformation.formatted_amount_available}}
Bitcoin amount desired    {{transactionInformation.formatted_bitcoin_amount_desired}} ฿
Fee required    {{transactionInformation.formatted_fee_required}} ฿
Payment timeframe (blocks)    {{transactionInformation.formatted_block_time_limit}}
Information Transaction type    {{transactionInformation.tx_type_str}}
Transaction ID    {{transactionInformation.tx_hash|characters:30}}
Included in block    {{transactionInformation.block}}
Index in block    {{transactionInformation.index}}
Block time    {{transactionInformation.tx_time | date:'yyyy-MM-dd HH:mm:ss UTC'}}
Transaction method    {{transactionInformation.method}}
Valid    

Yesterday it showed real values.
grazcoin
Sr. Member
****
Offline Offline

Activity: 284
Merit: 250



View Profile
January 20, 2014, 11:01:18 AM
 #923

Did you change something with sell offers, grazcoin? Because when I look at any of them now I see :

Transaction    {{transactionInformation.tx_hash}}
Sell offer details Seller    {{transactionInformation.from_address}}
Currency    {{transactionInformation.currency_str}}
Price per coin    {{transactionInformation.formatted_price_per_coin}} ฿/{{currency}} DO NOT POST SESC LINKS
Amount for sell    {{transactionInformation.formatted_amount}}
Amount available    {{transactionInformation.formatted_amount_available}}
Bitcoin amount desired    {{transactionInformation.formatted_bitcoin_amount_desired}} ฿
Fee required    {{transactionInformation.formatted_fee_required}} ฿
Payment timeframe (blocks)    {{transactionInformation.formatted_block_time_limit}}
Information Transaction type    {{transactionInformation.tx_type_str}}
Transaction ID    {{transactionInformation.tx_hash|characters:30}}
Included in block    {{transactionInformation.block}}
Index in block    {{transactionInformation.index}}
Block time    {{transactionInformation.tx_time | date:'yyyy-MM-dd HH:mm:ss UTC'}}
Transaction method    {{transactionInformation.method}}
Valid    

Yesterday it showed real values.

I just keep updating the site. Please press refresh ;-)
It is only browser's cache that makes this problem.


jakecnn
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
January 20, 2014, 11:21:35 AM
 #924

Clearing cache fixed it, thanks.

Keep up the good work  Smiley
jakecnn
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
January 20, 2014, 11:59:37 AM
 #925


Bitoy will be able to help you better but just a few pages back I had issues and found..

-Make sure you have none of you're files in your MyMastercoins folder set to read only! (You can do this by Right Click: Properties and make sure the box is un-checked) (Additionally make sure you have Full Control as an Administrator, you can do this as well by Right Click: Properties: Security make sure you have "Full Control")

Though that shouldn't have anything to do with Exception thrown: File not found.

I had a issue with the main setup.exe so I actually go into the MyMastercoinsTCW_1_0_0_1 folder and run MyMastercoinsTCW (Application).

None of the files are read-only.
How did you run MyMastercoinsTCW (Application) from the MyMastercoinsTCW_1_0_0_1 folder? If I try that, I get: ' You cannot start application MyMastercoinsTCW from this location because it is already installed from a different location'.
I have MyMastercoinsTCW (Application) twice, once in the mymastercoinsTCW folder and the other in MyMastercoinsTCW_1_0_0_1. If I run the one from mymastercoinsTCW I get the file not found stuff again. Is having MyMastercoinsTCW (Application) twice the problem?
jakecnn
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
January 20, 2014, 04:09:18 PM
Last edit: January 20, 2014, 04:22:07 PM by jakecnn
 #926

@grazcoin
I had a send of TMSC fail me.
I tried to send 0.118 TMSC from 14Q2NNiF5YzDZCjo7vrBuHdbZcmHRJyW3j to 1NVNkPqSLo4N2seaZCzAkVFPjcGLPJSZAZ.
The result was "Transaction sent" and the following link popped up, but the TX doesnt seem to exist.
https://blockchain.info/tx/85f63d87fe1aefacc9b85178565d4c065cfb3284fc440438d8bb8aec75ef5b5e
dacoinminster (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
January 20, 2014, 05:15:47 PM
 #927

The guys from engine.co found a potential race condition where the user could accidentally create a new sell order when they were trying to change an old one, because the old one had already been bought.

At my suggestion, Marv made this pull request to add a 2-confirmation time limit after a sale is complete before that address can initiate a new sell offer: https://github.com/mastercoin-MSC/spec/pull/38

I'm posting here because not respecting the time limit will lead to consensus divergence, so I want to make sure everybody is aware of it.

Thanks!

Perhaps it's the lack of sleep but I don't like the fact that this has been merged already, up till now everything we did was democratic. Shouldn't we discuss such a major change in the protocol before merging it? I would appreciate it if at least some examples could be given in how this is suppose to work before and after the merge.

I also think this pull request should be open for discussion like any other pull request.
my opinion:
I don't think this solution really solves this race condition, e.g. due to difference in fee amount and inputs complexity of the buy/sell change transactions, the sell offer change can still get merged 2 confirmations later, and then we're in the same race condition state.

Alternative solution would be to keep only the option to cancel the offer (amount zero), and omit the option to change it.
If one wants to make a change, he can first cancel the old offer, and then create a new one.

EDIT: it would be also much easier to implement, and reduce complexity.


My plus 1 for this idea. Separate messages make a lot of sense to me.

any update on this? J.R.?
I would like to update the implementation.


Apologies for jumping the gun on this guys! I was worried people would get bogged down waiting for a decision on this Smiley

I'm very happy to accept a pull request adding a cancel command instead. Is somebody available to jump on that task? I want to avoid hearing "I haven't made much progress because I'm waiting on a decision about issue X." Smiley

Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
January 20, 2014, 07:43:48 PM
 #928

I've added PR #39 (Graz's suggestion) and a variation PR #40.

Developers please read and give your +1 or -1's. Even without these PR's there are plenty of things to deal with.

I'm trying to improve the consensus tools we have available this week to add support for a service which can do consensus on the transaction level so we can more easily determine where our DEx implementations differ. In two weeks time I probably won't have to struggle to find the time to work on all this. Can't wait Smiley

Electrum: the convenience of a web wallet, without the risks | Bytesized Seedboxes BTC/LTC supported
grazcoin
Sr. Member
****
Offline Offline

Activity: 284
Merit: 250



View Profile
January 20, 2014, 07:57:29 PM
 #929

@grazcoin
I had a send of TMSC fail me.
I tried to send 0.118 TMSC from 14Q2NNiF5YzDZCjo7vrBuHdbZcmHRJyW3j to 1NVNkPqSLo4N2seaZCzAkVFPjcGLPJSZAZ.
The result was "Transaction sent" and the following link popped up, but the TX doesnt seem to exist.
https://blockchain.info/tx/85f63d87fe1aefacc9b85178565d4c065cfb3284fc440438d8bb8aec75ef5b5e

masterchain's server only prepares the raw transaction. From that moment, everything is done on the client, and the tx is sent to blockchain.info - so I have no logs from that moment.
From the logs of the transaction generation that you mentioned (see below), everything looks fine - maybe the fee is a little too low.
What could go wrong:
1. currently the tx is published indirectly using blockchain.info. Maybe something died on the way there. (soon there will be the option to publish directly using masterchain.info).
2. blockchain.info decided that the fee is too low (?)

I suggest that you try again, and if it doesn't work, send here the raw transaction as well as the signed transaction for inspection.

logs:
prepare_send_tx_for_signing: plain dataHex: --0100000000000000020000000000b40dc00000000000000000000000000000--
prepare_send_tx_for_signing: obfus dataHex: 029b07f670d5fc1b4e93be50bf51493046167bbd8bc133e1d012dde615a2383bfb
get_nearby_valid_pubkey: trying 029b07f670d5fc1b4e93be50bf51493046167bbd8bc133e1d012dde615a2383bfb
get_nearby_valid_pubkey: valid  029b07f670d5fc1b4e93be50bf51493046167bbd8bc133e1d012dde615a2383bfc
prepare_send_tx_for_signing: valid dataHex: 029b07f670d5fc1b4e93be50bf51493046167bbd8bc133e1d012dde615a2383bfc
prepare_send_tx_for_signing: change address is 14Q2NNiF5YzDZCjo7vrBuHdbZcmHRJyW3j
prepare_send_tx_for_signing: too_address is 1NVNkPqSLo4N2seaZCzAkVFPjcGLPJSZAZ
prepare_send_tx_for_signing: total inputs value is 298280
prepare_send_tx_for_signing: fee is 10000
prepare_send_tx_for_signing: dust limit is 5430
prepare_send_tx_for_signing: BIP11 script is 1 [ 029abce7b350f33266ff19ed9389bbdc0fda3692fe084aa87163b7de2e77052534 ] [ 029b07f670d5fc1b4e93be50bf51493046167bbd8bc133e1d012dde615a2383bfc ] 2 checkmultisig
Added input a7120ed05e1b42f48fec59d0a3b56202d15a0bb8272653f995ac584f16e67c09:3
Added output sending 5430 Satoshis to 1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P.
Added output sending 5430 Satoshis to 1NVNkPqSLo4N2seaZCzAkVFPjcGLPJSZAZ.
Added output sending 10860 Satoshis to 1 [ 029abce7b350f33266ff19ed9389bbdc0fda3692fe084aa87163b7de2e77052534 ] [ 029b07f670d5fc1b4e93be50bf51493046167bbd8bc133e1d012dde615a2383bfc ] 2 checkmultisig.
Added output sending 266560 Satoshis to 14Q2NNiF5YzDZCjo7vrBuHdbZcmHRJyW3j.


jakecnn
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
January 21, 2014, 09:42:51 AM
Last edit: January 21, 2014, 12:42:02 PM by jakecnn
 #930

Transactions before and after worked well, just wanted to mention that transactions can still fail, despite the notification "Transaction sent".
Also, I didn't know that the TX is being sent client-wise.

Btw, is there a way to send the signed transaction using bitcoin-qt? I've tried sendrawtransaction with the signed raw transaction, but I get 'TX rejected (code -22)'.
Would it speed up confirming the TX, since blockchain.info shows a queue position? Or do they broadcast the transaction straight away?
grazcoin
Sr. Member
****
Offline Offline

Activity: 284
Merit: 250



View Profile
January 21, 2014, 05:11:50 PM
 #931

Transactions before and after worked well, just wanted to mention that transactions can still fail, despite the notification "Transaction sent".
Also, I didn't know that the TX is being sent client-wise.

Btw, is there a way to send the signed transaction using bitcoin-qt? I've tried sendrawtransaction with the signed raw transaction, but I get 'TX rejected (code -22)'.
Would it speed up confirming the TX, since blockchain.info shows a queue position? Or do they broadcast the transaction straight away?

You could send the (signed) tx directly to the bitcoin network via:
Code:
./bitcoind sendrawtransaction 01000....

It will not make any difference, as the queue position that you see, is not internal to blockchain.info, but an estimation of the status of the tx in the bitcoin network (taking into account its inputs complexity and amount of fee).

In future version the send would use masterchain.info directly.


dacoinminster (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
January 21, 2014, 05:17:00 PM
 #932

150 BTC TO BE AWARDED TOMORROW - PLEASE POST A SUMMARY OF YOUR WORK TOWARD THE DISTRIBUTED EXCHANGE

Everyone participating in the current coding contest bounty: please post a summary of all your work to date here in this thread. Go through your old emails, commits, and forum posts. Do not assume that everyone remembers what you did. Please be as complete as possible - you will be reading each others' summaries and using that information to determine payout sizes for each other. Any work which contributed to the distributed exchange should be included, including prerequisite work such as fixing our consensus issues.

If you did both development work and testing work, post separate summaries for each, since those bounties are awarded independently of each other.

As before, I'll ask each of you to tell me how you would divvy up the money (percentage-wise) if you weren't participating in the contest. I realize this is a difficult task, but it is very important, and I have seen first-hand how well you guys work together as a team when you know that you'll be evaluating each other's work at payout time.

Thanks to each of you for your hard work. I hope each of you enjoys the fruit of your labor. Smiley

jakecnn
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
January 21, 2014, 11:34:07 PM
Last edit: January 22, 2014, 11:44:01 AM by jakecnn
 #933

@grazcoin
Test 1: Theres no partially done/ wrong symbol showing up.
Test 2: Sale offer status does not change to done after the full amount has been bought and paid.
Test 3: After expiration of the bid, the symbol of the sale offer stays half blue/green.
Test 4: The partially done/fully accepted doesnt show up either.
Test 5: Cancelled offers still show up. Someone mentioned it before I think.
Test 7: Sell accept goes through, even though offer was cancelled before.
Test 8: I bid 0.02 from 1NVNkPqSLo4N2seaZCzAkVFPjcGLPJSZAZ, and the amount accepted is listed as 0.02, even though only 0.01 was offered. Someone else bid on it aswell, and both offers show up as accepted.
https://masterchain.info/selloffer.html?tx=b9e6b1f6f428441d7e91e7715ed4524de942b8d755367828e1d85ca850a9dc43&currency=TMSC

Are multiple sell offers per address a feature or a bug? I've got 3 on one address, 2 of them have the same price.
There's also something off with amounts for sell/available. Take a look at https://masterchain.info/selloffer.html?tx=8b2deeb03c2590bbc6698ab3d663eb920e8bb7e89437a7984a54b8d0154d6741&currency=TMSC . 0.01 were initially available, 0.002 + 0.007 were bought, so only 0.001 should remain, but amount available shows 0.003.

Also, newly created offers seem to always show 0 as amount available, shouldn't it match the amount for sell?
grazcoin
Sr. Member
****
Offline Offline

Activity: 284
Merit: 250



View Profile
January 22, 2014, 01:11:31 AM
 #934

@grazcoin
Test 2: Sale offer status does not change to done after the full amount has been bought and paid.
Test 3: After expiration of the bid, the symbol of the sale offer stays half blue/green.

Are multiple sell offers per address a feature or a bug? I've got 3 on one address, 2 of them have the same price.
There's also something off with amounts for sell/available. Take a look at https://masterchain.info/selloffer.html?tx=8b2deeb03c2590bbc6698ab3d663eb920e8bb7e89437a7984a54b8d0154d6741&currency=TMSC . 0.01 were initially available, 0.002 + 0.007 were bought, so only 0.001 should remain, but amount available shows 0.003.

Also, newly created offers seem to always show 0 as amount available, shouldn't it match the amount for sell?

Thanks.
Test 2 + test 3 are known issues (at least to me ;-))
There are also more minor issues with icon color updates - all should be fixed soon.

As for multiple sell offers per address - this is a bug. Currently the logic that checks older offers on the same address is not yet implemented. I wait for deciding which of the pull request is chosen (39,40,41), and then it will be implemented.

Newly created offer should match the amount to sell. This I didn't see. Will be checked.


mastream
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
January 22, 2014, 02:29:19 AM
Last edit: January 22, 2014, 03:19:42 AM by mastream
 #935

one more thing about available coins:
should it be possible, that a sell offer has more available coins, than are for sale?
i'm talking about this offer: https://masterchain.info/selloffer.html?tx=b9e6b1f6f428441d7e91e7715ed4524de942b8d755367828e1d85ca850a9dc43&currency=TMSC

it has 0.01 TMSC offered and 0.065 available. screenshot is taken in case that's a temporary issue.

I just bought some TMSC from there, let's see what happens Smiley


edit:

ok, after I did the payment and everything was confirmed, the available coins changed to 0, so it seems that was temporary and doesn't cause any issues.

apart from that everything appears to be fine on my side, accepting and paying for the offer was no problem.
at the moment my address doesn't have consensus across all implementations though


edit 2:
@grazcoin: i can now also see addresses that I added to the wallet. I don't know if you changed something, but if you did, it worked Smiley
Westphalian
Newbie
*
Offline Offline

Activity: 47
Merit: 0



View Profile
January 22, 2014, 03:10:36 AM
 #936

Is there anywhere I can buy test mastercoins for testnet bitcoins?
Ideally this would be part of the test plan for the DEx.
I was able to acquire some testnet bitcoins and they work with bitcoin-qt.
When you run 'bitcoin-qt -testnet' it syncs with the blockchain near instantly.
Voila, you've got testnet bitcoins but nowhere to spend them.  Sad
aTriz
Hero Member
*****
Offline Offline

Activity: 1218
Merit: 683


Tontogether | Save Smart & Win Big


View Profile
January 22, 2014, 03:24:01 AM
 #937

Did we ever fix the balance issue with my account (1LjT88X7Zu8BdbqJw8vfRa83NJuzYL9kqm) Don't really care about the TSMC but just wanted to make sure there wasn't something that could cause a issue later on down the road...

I see 106.12380845 TMSC on Masterchest

108.12380845 TSMC on Masterchain

107.12380845 TSMC on mastercoin-explorer

It seems 107.12380845 is the correct amount (1 Reserved for current sale offer, for a Total of 108.12380845)


mastream
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
January 22, 2014, 03:36:54 AM
 #938

Is there anywhere I can buy test mastercoins for testnet bitcoins?
Ideally this would be part of the test plan for the DEx.
I was able to acquire some testnet bitcoins and they work with bitcoin-qt.
When you run 'bitcoin-qt -testnet' it syncs with the blockchain near instantly.
Voila, you've got testnet bitcoins but nowhere to spend them.  Sad


As far as I know, TMSC are only exchanged for BTC. Since the test BTC don't interact with the actual BTC blockchain there's also no way of getting TMSC for testnet bitcoins.
if you try buying TMSC on the masterchain.info DEx with your testnet bitcoins it will just tell you that your testnet address can't be found on the blockchain ( but I just tried it to make sure Smiley )
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
January 22, 2014, 04:02:05 AM
 #939

Checking to see If I got the rule on Selling Offers.
A Sell Offer must be cancelled before sending another sell offer is accepted.
(To cancel a sell offer AmountofCoin for Sale to 0 )

The Tx below will be invalid
1b8572009435e554a68fc640f43efa50c9117f6881813ae56eab5b10f9b3fd53     
(Invalid Offer to Sell: 0.01 TMSC.  )

because Offer to Sell     
8b2deeb03c2590bbc6698ab3d663eb920e8bb7e89437a7984a54b8d0154d6741
still open and not yet cancelled?

 


Westphalian
Newbie
*
Offline Offline

Activity: 47
Merit: 0



View Profile
January 22, 2014, 04:27:30 AM
 #940

Is there anywhere I can buy test mastercoins for testnet bitcoins?
Ideally this would be part of the test plan for the DEx.
I was able to acquire some testnet bitcoins and they work with bitcoin-qt.
When you run 'bitcoin-qt -testnet' it syncs with the blockchain near instantly.
Voila, you've got testnet bitcoins but nowhere to spend them.  Sad


As far as I know, TMSC are only exchanged for BTC. Since the test BTC don't interact with the actual BTC blockchain there's also no way of getting TMSC for testnet bitcoins.
if you try buying TMSC on the masterchain.info DEx with your testnet bitcoins it will just tell you that your testnet address can't be found on the blockchain ( but I just tried it to make sure Smiley )

Ah, I see. Thanks.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 [47] 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!