Post
Topic
Board Announcements (Altcoins)
Re: NXT :: descendant of Bitcoin - Updated Information
by
Come-from-Beyond
on 05/02/2014, 09:37:35 UTC
Btw, what do u think of the approach when dumb actions, like an attempt to cancel a non-existent bid order, r processed without sanity checks? The fee is paid, transaction is added to the block but the state is not changed.
I don't like the idea, at least in this case it is very simple to enforce such a check, in Transaction.Type.ColoredCoins.ASK_ORDER_CANCELLATION just add:

boolean validateAttachment(Transaction transaction) {
                    Attachment.ColoredCoinsAskOrderCancellation attachment = (Attachment.ColoredCoinsAskOrderCancellation)transaction.attachment;
                    if (Order.Ask.getAskOrder(attachment.getOrderId()) == null) {
                        return false;
                    }
                    return Genesis.CREATOR_ID.equals(transaction.recipientId) && transaction.amount == 0;
}


It's not that simple, coz validateAttachment() will return true for 2 different unconfirmed transactions that cancel the same order. After one of them is confirmed another transaction will never be confirmed. This makes it very cheap to DoS nodes - just send 1000000 transactions that cancel the same order. If we included all such transactions into blocks then DoSing would be very expensive.

Is there another way to counteract the DoS attack?