Lisk-sdk: Add "round ticks" (forwards/backwards) to the same promise chain as Chain.prototype.saveBlock

Created on 12 Jan 2018  路  3Comments  路  Source: LiskHQ/lisk-sdk

Parent: #302

Continuation of: #1181

Current behavior

BEGIN DB TRANSACTION
  Apply unconfirmed transaction
  Apply confirmed transaction
  Insert block
  Insert transaction
  Insert transaction type
COMMIT

BEGIN DB TRANSACTION
  Round tick
COMMIT

Proposed behavior

BEGIN DB TRANSACTION
  Apply unconfirmed transaction
  Apply confirmed transaction
  Insert block
  Insert transaction
  Insert transaction type
  Round tick
COMMIT

Code Target

https://github.com/LiskHQ/lisk/blob/development/logic/round.js
https://github.com/LiskHQ/lisk/blob/development/modules/rounds.js

Most helpful comment

@karmacoma After closing #1181 the current behaviour is:

BEGIN DB TRANSACTION
  Apply unconfirmed transaction
  Apply confirmed transaction
  Insert block
  Insert transaction
  Insert transaction type
  BEGIN DB TRANSACTION
      Round tick
  COMMIT
COMMIT

All 3 comments

@karmacoma After closing #1181 the current behaviour is:

BEGIN DB TRANSACTION
  Apply unconfirmed transaction
  Apply confirmed transaction
  Insert block
  Insert transaction
  Insert transaction type
  BEGIN DB TRANSACTION
      Round tick
  COMMIT
COMMIT

It is currently on hold, as we have absolutely no tests for that functionality, while the change seems trivial.

@vitaly-t I reasigned it, as I need it fixed for https://github.com/LiskHQ/lisk/issues/1303

Behavior described in https://github.com/LiskHQ/lisk/issues/1297#issuecomment-357358923 is not valid, it still uses different connection handler for tick - so round logic don't see block that is already saved to database (in different SQL transaction).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hendrikhofstadt picture hendrikhofstadt  路  4Comments

ManuGowda picture ManuGowda  路  3Comments

MaciejBaj picture MaciejBaj  路  3Comments

ManuGowda picture ManuGowda  路  3Comments

MaciejBaj picture MaciejBaj  路  4Comments