Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC for /block #6

Merged
merged 44 commits into from
Jun 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0667986
inital database schema for block storage (#4)
andynog May 12, 2023
8f9817e
add uint64 domain (#4)
andynog May 12, 2023
955e38a
minor fixes and renames (#4)
andynog May 12, 2023
eb6f6db
More info README (#4)
andynog May 12, 2023
6ea65de
update and fix sql scripts, add sequence number (#4)
andynog May 12, 2023
3701cdd
refactoring some fields (#4)
andynog May 15, 2023
cf130ff
initial logic to insert some blocks (#1)
andynog May 15, 2023
119418d
added more block data, refactoring schema (#1)
andynog May 17, 2023
39065f9
initial logic for rpc service (#3)
andynog May 18, 2023
9c95bec
initial logic to return block data (#3)
andynog May 18, 2023
0b712fe
started to add block data (#1)
andynog May 23, 2023
b5bfdd7
added logic to insert block transactions (#1)
andynog May 23, 2023
482e2cd
added last_block_id information (#1)
andynog May 24, 2023
a22ff7f
added header_version information (#1)
andynog May 24, 2023
b92accb
added remaining block header fields (#1)
andynog May 24, 2023
e683a6b
rename last_block_id columns to match header (#4)
andynog May 24, 2023
97c4bb8
Added block last commit info (#1)
andynog May 24, 2023
a73131d
update postgres docker image version (#4)
andynog May 24, 2023
49e1291
added block_id info (#1)
andynog May 25, 2023
8a007b5
remove private key (no need) from block_data table (#4)
andynog May 25, 2023
4db94a0
make endpoint configurable and retrieve last height (#1)
andynog May 25, 2023
5ec97d4
added last_commit_signature info (#4)
andynog May 25, 2023
ed63d1c
added last_commit_signatures info (#1)
andynog May 25, 2023
6b8a428
initial schema for evidence (#4)
andynog May 31, 2023
db032e7
adding duplicate_vote_evidence table (#4)
andynog May 31, 2023
e96f3c2
added logic to insert duplicate vote evidence (#1)
andynog Jun 1, 2023
55960fa
initial logic to return a duplicate vote evidence (#3)
andynog Jun 2, 2023
c493351
fully implemented the duplicate vote evidence response (#3)
andynog Jun 2, 2023
cc3ed26
Initial schema for light client attack evidence (#4)
andynog Jun 2, 2023
f29ba7d
reshuffle sequence (#4)
andynog Jun 5, 2023
0d7791d
some clean up (#1)
andynog Jun 5, 2023
78beb10
adding initial schema for light client attack evidence (#4)
andynog Jun 7, 2023
1414d95
initial logic to insert light client attack evidence (#1)
andynog Jun 7, 2023
14838e9
refactoring some schema names (#4)
andynog Jun 7, 2023
778f632
initial logic to return light client attack evidence (#3)
andynog Jun 7, 2023
4834d83
simplified schema creation merged into one file (#4)
andynog Jun 19, 2023
f1c4876
initial service commands implementation #1 #3
andynog Jun 19, 2023
90f7890
refactoring logic into services, initial ingest service implementatio…
andynog Jun 20, 2023
3c9a97a
implemented RPC as a service (#3)
andynog Jun 20, 2023
4a8c39b
fixed logic to return proper json using CometBFT libs/json (#3)
andynog Jun 21, 2023
eefe263
minor refactoring (#3)
andynog Jun 22, 2023
757e142
adding logic to store validator struct (#4)
andynog Jun 23, 2023
eb8d65c
added logic to add normalized byzantine validator for lca evidence (#…
andynog Jun 26, 2023
56c676a
added byzantine validators return in light client attack evidence (#3)
andynog Jun 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added block_id info (#1)
andynog committed May 25, 2023

Verified

This commit was signed with the committer’s verified signature.
phillip-kruger Phillip Krüger
commit 49e12915b24f208f8289116c046590d34bf1458b
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -202,9 +202,13 @@ func (c *PostgresStorage) InsertTransaction(height int64, tx types.Tx) (bool, er
func (c *PostgresStorage) GetBlock(height int64) (ctypes.ResultBlock, error) {
resultBlock := ctypes.ResultBlock{}
lastCommit := types.Commit{}

bId := types.BlockID{}
b := new(types.Block)

row := c.Connection.QueryRow("SELECT "+
"block_id_hash, "+
"block_id_parts_hash, "+
"block_id_parts_total, "+
"block_header_height, "+
"block_header_chain_id, "+
"block_header_block_time, "+
@@ -229,6 +233,9 @@ func (c *PostgresStorage) GetBlock(height int64) (ctypes.ResultBlock, error) {
"block_last_commit_block_id_parts_hash "+
"FROM comet.result_block WHERE block_header_height=$1", height)
err := row.Scan(
&bId.Hash,
&bId.PartSetHeader.Hash,
&bId.PartSetHeader.Total,
&b.Header.Height,
&b.Header.ChainID,
&b.Header.Time,
@@ -255,6 +262,7 @@ func (c *PostgresStorage) GetBlock(height int64) (ctypes.ResultBlock, error) {
return resultBlock, err
}
b.LastCommit = &lastCommit
resultBlock.BlockID = bId
resultBlock.Block = b

// Retrieve transactions if any