Skip to content

Commit

Permalink
(unfinished) consensus: store finalized roothash messages
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed Jan 5, 2024
1 parent c3e7487 commit e0a9684
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions analyzer/consensus/data_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ func fetchRootHashData(ctx context.Context, cc nodeapi.ConsensusApiLite, height
return nil, err
}

lrr, err := cc.RoothashGetLastRoundResults(ctx, height)

return &rootHashData{
Height: height,
Events: events,
Expand Down
11 changes: 11 additions & 0 deletions analyzer/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ var (
schedule_height = excluded.schedule_height,
message = excluded.message`

ConsensusRoothashMessageFinalizeUpsert = `
INSERT INTO chain.roothash_messages
(runtime, round, message_index, finalize_height, error_module, error_code, result)
VALUES
($1, $2, $3, $4, $5, $6, $7)
ON CONFLICT (runtime, round, message_index) DO UPDATE
SET
error_module = excluded.error_module,
error_code = excluded.error_code,
result = excluded.result`

ConsensusAccountRelatedTransactionInsert = `
INSERT INTO chain.accounts_related_transactions (account_address, tx_block, tx_index)
VALUES ($1, $2, $3)`
Expand Down

0 comments on commit e0a9684

Please sign in to comment.