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

Parallel verification issues #1420

Closed
shargon opened this issue Jan 16, 2020 · 4 comments · Fixed by #1429
Closed

Parallel verification issues #1420

shargon opened this issue Jan 16, 2020 · 4 comments · Fixed by #1429
Labels
Bug Used to tag confirmed bugs Critical Issues (bugs) that need to be fixed ASAP

Comments

@shargon
Copy link
Member

shargon commented Jan 16, 2020

Describe the bug
While reviewing the bug #1410 I used multiple threads for the rpc request and I advice that it produce a similar denial of services that is described in #1410

The error was produced here

if (engine.Execute() != VMState.HALT) throw new InvalidOperationException();

image

Because a double spend in Gas native token

if (state.Balance < amount) throw new InvalidOperationException();

image

To Reproduce
Steps to reproduce the behavior:

  1. Create a 1 node network
  2. install rpc module
  3. open wallet by rpc
  4. send multiple sends with at least 5 threads
{
  "jsonrpc": "2.0",
  "method": "sendtoaddress",
  "params": ["0x8c23f196d8a1bfd103a9dcb1f9ccf0c611377d3b", "NNa1Fgc82Qoh65TJfViqC92W8Z8AWL9YKA",0.00000001],
  "id": 1
}

Expected behavior
Consensus nodes are expected to handle massive txs.

Additional context
Possible fix #1417

@Tommo-L
Copy link
Contributor

Tommo-L commented Jan 17, 2020

I think this is the reason, I'll test it.
image

@eryeer
Copy link
Contributor

eryeer commented Jan 17, 2020

That make sense, we need to recheck the balance after parallelVerify.

@shargon
Copy link
Member Author

shargon commented Jan 18, 2020

@Tommo-L If it's scenario, it's not related to parallel verification because TX1 and TX2 can enter in mempool with balance, and later transfer his funds to other address, when they enter in the block, the second one can produce the same behaviour.

@Tommo-L
Copy link
Contributor

Tommo-L commented Jan 19, 2020

No, it's related to parallel verification.

If the transaction will transfer his funds to other address, it'll update the mempool after persisted by Mempool.UpdatePoolForBlockPersisted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Used to tag confirmed bugs Critical Issues (bugs) that need to be fixed ASAP
Projects
None yet
3 participants