nooschain / node-sync/remote-block-ingestion / insertAndExecuteRemoteBlock
Function: insertAndExecuteRemoteBlock()
insertAndExecuteRemoteBlock(
db,block,expectedPreviousHash,localNodeId?,verifiedNodeMembership?,peer?,conflictPolicy?,executionOptions?):Promise<string[]>
Defined in: node-sync/remote-block-ingestion.ts:55
Inserts and executes one remote block inside a transaction.
Existing identical blocks are idempotent. Existing same-height different-hash rows become finalized conflicts. Ciphertext retention is decided by local payload replication policy during execution, not by the remote peer.
The returned string array contains verification issues. The success path returns an empty array; mismatches are raised as SyncConflictError before the transaction can commit.
Parameters
db
Kysely<Database>
block
expectedPreviousHash
string | null
localNodeId?
string
verifiedNodeMembership?
peer?
conflictPolicy?
ChainConflictPolicy = defaultConflictPolicy
executionOptions?
Pick<BlockExecutionOptions, "instrumentation"> = {}
Returns
Promise<string[]>