Open
Conversation
…ol/go-ten into will/verify-contracts
zkokelj
reviewed
Jan 9, 2026
Contributor
zkokelj
left a comment
There was a problem hiding this comment.
Minor comments/questions. Otherwise it looks good to me.
Contributor
Author
|
@zkokelj made a few important changes:
|
zkokelj
approved these changes
Jan 21, 2026
Contributor
zkokelj
left a comment
There was a problem hiding this comment.
LGTM with a few minor comments:
- INT -> BIGINT
- query optimisation (if possible? otherwise you can keep it as it is)
- if we decided to not use ID then we can remove it in some places, but also happy if we want to keep that
| creator BYTEA NOT NULL, | ||
| transparent BOOLEAN NOT NULL, | ||
| custom_config BOOLEAN NOT NULL, | ||
| batch_seq INT NOT NULL, |
Contributor
There was a problem hiding this comment.
those two (batch_seq, height) should be BIGINT to be consistent with uint64 (potential overflow).
just like time (which is ok)
| } | ||
|
|
||
| var total uint64 | ||
| reboundCountQuery := db.GetSQLDB().Rebind(selectContractCount) |
Contributor
There was a problem hiding this comment.
any reason why are we not using "SELECT total FROM contract_count WHERE id = 1" like we do in GetTotalContractCount?
| } | ||
|
|
||
| type PublicContract struct { | ||
| ID uint64 `json:"id"` |
Contributor
There was a problem hiding this comment.
Is this ID needed if we decided to remove it?
|
|
||
| const ( | ||
| insertContract = "INSERT INTO contract_host (address, creator, transparent, custom_config, batch_seq, height, time) VALUES (?, ?, ?, ?, ?, ?, ?)" | ||
| selectContract = "SELECT id, address, creator, transparent, custom_config, batch_seq, height, time FROM contract_host" |
| var addressBytes, creatorBytes []byte | ||
|
|
||
| err = rows.Scan( | ||
| &contract.ID, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this change is needed
https://github.com/ten-protocol/ten-internal/issues/6043
This is just the first part of dev, second part will add balances and event logs
What changes were made as part of this PR
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks