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

feat(store): add rawlog in txstatus #1458

Merged

Conversation

ninabarbakadze
Copy link
Member

@ninabarbakadze ninabarbakadze commented Aug 15, 2024

Description

Fixes #1454

@ninabarbakadze ninabarbakadze marked this pull request as ready for review August 15, 2024 10:25
@ninabarbakadze ninabarbakadze requested a review from a team as a code owner August 15, 2024 10:25
@ninabarbakadze ninabarbakadze requested review from cmwaters and evan-forbes and removed request for a team August 15, 2024 10:25
evan-forbes
evan-forbes previously approved these changes Aug 15, 2024
rootulp
rootulp previously approved these changes Aug 15, 2024
Comment on lines 19 to 21
// The unprocessed log output generated during
// the execution of a transaction.
string raw_log = 4;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question] is there a non-raw / processed form of the log? Other names in this PR call it logs, response.Log so if there is actually no difference between raw log and log, proposal to rename it to log for consistency:

Suggested change
// The unprocessed log output generated during
// the execution of a transaction.
string raw_log = 4;
// The unprocessed log output generated during
// the execution of a transaction.
string log = 4;

proto/tendermint/store/types.proto Outdated Show resolved Hide resolved
store/store.go Outdated
@@ -466,6 +470,10 @@ func (bs *BlockStore) SaveTxInfo(block *types.Block, txResponseCodes []uint32) e
Index: uint32(i),
Code: txResponseCodes[i],
}
// Only add rawLog for failed transactions
if txResponseCodes[i] != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would put abci.CodeTypeOk instead of relying on numbers

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -414,6 +417,12 @@ func TestSaveTxInfo(t *testing.T) {
require.Equal(t, block.Height, txInfo.Height)
require.Equal(t, uint32(i), txInfo.Index)
require.Equal(t, txResponseCodes[i], txInfo.Code)
// We don't save the logs for successful transactions
if txResponseCodes[i] == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[optional]

Suggested change
if txResponseCodes[i] == 0 {
if txResponseCodes[i] == abci.CodeTypeOK {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved in a previous commit! thanks rootul!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this instance was resolved in a previous commit though

@ninabarbakadze ninabarbakadze enabled auto-merge (squash) August 15, 2024 13:40
@ninabarbakadze ninabarbakadze merged commit 9563209 into celestiaorg:v0.34.x-celestia Aug 15, 2024
19 checks passed
@ninabarbakadze ninabarbakadze deleted the nina/add-rawlog branch August 15, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add RawLog in TxStatus
4 participants