ENT-6875 Two Phase Finality - CLEAN-UP (#7321)

* Remove completed TODOs

* Prevent mis-leading progress tracker message.
This commit is contained in:
Jose Coll 2023-03-24 08:55:37 +00:00 committed by GitHub
parent beb0e885fb
commit b4983597e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -231,6 +231,7 @@ class FinalityFlow private constructor(val transaction: SignedTransaction,
serviceHub.telemetryServiceInternal.span("${this::class.java.name}#recordLocallyAndBroadcast", flowLogic = this) { serviceHub.telemetryServiceInternal.span("${this::class.java.name}#recordLocallyAndBroadcast", flowLogic = this) {
recordUnnotarisedTransaction(tx) recordUnnotarisedTransaction(tx)
logger.info("Recorded transaction without notary signature locally.") logger.info("Recorded transaction without notary signature locally.")
if (sessions.isEmpty()) return
progressTracker.currentStep = BROADCASTING_PRE_NOTARISATION progressTracker.currentStep = BROADCASTING_PRE_NOTARISATION
sessions.forEach { session -> sessions.forEach { session ->
try { try {

View File

@ -305,8 +305,6 @@ class DBTransactionStorage(private val database: CordaPersistence, cacheFactory:
val update = session.createQuery(criteriaUpdate) val update = session.createQuery(criteriaUpdate)
val rowsUpdated = update.executeUpdate() val rowsUpdated = update.executeUpdate()
if (rowsUpdated == 0) { if (rowsUpdated == 0) {
// indicates race condition whereby ReceiverFinality MISSING_NOTARY_SIG overwritten to UNVERIFIED by ResolveTransactionsFlow (in follow-up txn)
// TO-DO: ensure unverified txn signatures are validated prior to recording (https://r3-cev.atlassian.net/browse/ENT-9566)
val criteriaUpdateUnverified = criteriaBuilder.createCriteriaUpdate(DBTransaction::class.java) val criteriaUpdateUnverified = criteriaBuilder.createCriteriaUpdate(DBTransaction::class.java)
val updateRootUnverified = criteriaUpdateUnverified.from(DBTransaction::class.java) val updateRootUnverified = criteriaUpdateUnverified.from(DBTransaction::class.java)
criteriaUpdateUnverified.set(updateRootUnverified.get<ByteArray>(DBTransaction::signatures.name), signatures.serialize(context = contextToUse().withEncoding(SNAPPY)).bytes) criteriaUpdateUnverified.set(updateRootUnverified.get<ByteArray>(DBTransaction::signatures.name), signatures.serialize(context = contextToUse().withEncoding(SNAPPY)).bytes)
@ -342,7 +340,6 @@ class DBTransactionStorage(private val database: CordaPersistence, cacheFactory:
val cacheValue = TxCacheValue(transaction, status = TransactionStatus.UNVERIFIED) val cacheValue = TxCacheValue(transaction, status = TransactionStatus.UNVERIFIED)
val added = addWithDuplicatesAllowed(transaction.id, cacheValue) { k, v, existingEntry -> val added = addWithDuplicatesAllowed(transaction.id, cacheValue) { k, v, existingEntry ->
if (existingEntry.status == TransactionStatus.MISSING_NOTARY_SIG) { if (existingEntry.status == TransactionStatus.MISSING_NOTARY_SIG) {
// TODO verify signatures on passed in transaction include notary (See https://r3-cev.atlassian.net/browse/ENT-9566))
session.merge(toPersistentEntity(k, v)) session.merge(toPersistentEntity(k, v))
true true
} else false } else false