Skip to content

Drive accepts invalid Identity create transition in mempool (chainlock race condition) #3552

@pshenmic

Description

@pshenmic

Expected Behavior

Drive should throw a error and do not add any invalid platform state transitions in the mempool.

Current Behavior

There is a race condition in identity registration state with chain lock asset lock proof state transitions. When you receive the block's chain lock event (by DAPI or ZMQ), it is not yet fully processed in the platform, and if user tries to create a identity create state transition, drive returns a error:

Error: Asset Lock proof core chain height 1459620 is higher than the current consensus core height 1459619.

This occurs because you receive chainlock event almost in the same time as the platform nodes, and its just not enough time for platform quorum to finish processing, the platform has to produce a new block first that will lock to that new coreChainLockHeight.

Usually, a small timeout solves that issue, however such transactions successfully propogate to the Tenderdash nodes, and even when platform receives a proper chain lock height lock, it fails to execute on rebroadcast, the next tries on DAPI broadcastStateTransition returns an Internal Server Error:

tx%20already%20exists%20in%20cache

Possible Solution

Drive should correctly reject such transaction and do not add that transaction to mempool.

Steps to Reproduce (for bugs)

  1. Subscribe to chainlock events
  2. Create an assetlock transaction
  3. Wait for an chainlock event
  4. Create an identity registration state transition with chainlock asset lock proof
  5. Try to broadcast it through the network
  6. Transaction fails to broadcast because platform is not yet processed and locked to that chainlock height
  7. Transaction fails to broadcast on that node, even when platform actually process that chain lock height

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop, server, or mobile):
  • Link to your project:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions