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

Remove some oversized logs #14054

Merged
merged 6 commits into from Sep 22, 2023
Merged

Remove some oversized logs #14054

merged 6 commits into from Sep 22, 2023

Conversation

georgeee
Copy link
Member

@georgeee georgeee commented Sep 7, 2023

There are many logs emitted by Mina which are unnecessarily large and in some case become oversized.

This PR aims to fix many of such logs, reducing the amount of data printed.

Explain your changes:

  • Rewrite all of the logs that print directly or indirectly snark work, transaction or state transition data (as these pieces are potentially unbound in size)

Explain how you tested your changes:

  • Before the change, cluster's logs were polluted by extra-large logs in .mina-config/mina.log* and oversized logs in .mina-config/mina-oversized-logs.log*
  • After the change, extra large and oversized logs went away

Checklist:

  • Dependency versions are unchanged
    • Notify Velocity team if dependencies must change in CI
  • Modified the current draft of release notes with details on what is completed or incomplete within this project
  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? None

@georgeee georgeee requested review from a team as code owners September 7, 2023 12:31
@georgeee georgeee self-assigned this Sep 7, 2023
@georgeee
Copy link
Member Author

georgeee commented Sep 7, 2023

!ci-build-me

Base automatically changed from georgeee/refactor-graphql-file to berkeley September 8, 2023 11:25
@georgeee georgeee force-pushed the georgeee/remove-oversized-logs branch from fed95d4 to 5008593 Compare September 8, 2023 11:47
@georgeee
Copy link
Member Author

georgeee commented Sep 8, 2023

!ci-build-me

, `List
(List.map user_cmds
~f:(With_status.to_yojson User_command.Valid.to_yojson) ) )
, `List (List.map user_cmds ~f:(With_status.to_yojson tx_hash_json)) )
Copy link
Member

Choose a reason for hiding this comment

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

It is this change that's causing the verification key test to fail. You'll want to find using transaction hash here

Copy link
Member Author

Choose a reason for hiding this comment

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

@deepthiskumar I believe I do now exactly as you say: https://github.com/MinaProtocol/mina/pull/14054/files#diff-76bbbeef12ee2aa92308935beebc5d6b45b2343aeb90e561b3e3cbe76e7aa045R289

Also, awkwardly, although nearly all intg tests and other sections of verify test rely on the same zkapp_to_be_included_in_frontier function, only last two sections of verification-key test fail.

@georgeee georgeee force-pushed the georgeee/remove-oversized-logs branch from 5008593 to e402644 Compare September 11, 2023 22:19
@deepthiskumar
Copy link
Member

!ci-build-me

5 similar comments
@deepthiskumar
Copy link
Member

!ci-build-me

@deepthiskumar
Copy link
Member

!ci-build-me

@deepthiskumar
Copy link
Member

!ci-build-me

@psteckler
Copy link
Member

!ci-build-me

@psteckler
Copy link
Member

!ci-build-me

georgeee and others added 5 commits September 21, 2023 23:14
There are many logs emitted by Mina which are unnecessarily large and in
some case become oversized.

This PR aims to fix many of such logs, reducing the amount of data
printed.
@georgeee georgeee force-pushed the georgeee/remove-oversized-logs branch from c8653bd to 9324696 Compare September 21, 2023 21:15
@georgeee
Copy link
Member Author

!ci-build-me

@georgeee
Copy link
Member Author

!ci-nightly-me

@georgeee
Copy link
Member Author

Copy link
Member

@deepthiskumar deepthiskumar left a comment

Choose a reason for hiding this comment

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

I think we should have fee payer part of transactions to help with debugging. We can have a summary type for transactions and display fee payer pk, nonce, fee and signature. Resource_pool.Diff.t already has one, maybe we can add transaction summary to it?

[ ( "parent_hash"
, Breadcrumb.parent_hash crumb |> State_hash.to_yojson )
]
"Producing new block with parent $parent_hash%!" ;
Copy link
Member

Choose a reason for hiding this comment

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

Could you add protocol state please? These logs are useful when debugging

~metadata:
[ ("command", Zkapp_command.to_yojson zkapp_command)
; ("error", `String e)
[ ( "signature"
Copy link
Member

Choose a reason for hiding this comment

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

I think the entire fee payer account update (pk and nonce) might be helpful?

else state_hash_data ) ) ) ;
[ ( "state_hash"
, `String (State_hash.to_base58_check hash) )
] ) ) ;
Copy link
Member

Choose a reason for hiding this comment

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

Could you add protocol state here as well?

@@ -9,8 +9,7 @@ exception No_initial_peers

type Structured_log_events.t +=
| Gossip_new_state of { state_hash : State_hash.t }
| Gossip_transaction_pool_diff of
{ txns : Transaction_pool.Resource_pool.Diff.t }
| Gossip_transaction_pool_diff of { fee_payer_sigs : Signature.t list }
Copy link
Member

Choose a reason for hiding this comment

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

Can we add fee payer key and nonce as well? Helps when debugging

@@ -366,7 +366,8 @@ module type Transaction_pool_diff_intf = sig
end

type Structured_log_events.t +=
| Transactions_received of { txns : t; sender : Envelope.Sender.t }
| Transactions_received of
{ fee_payer_sigs : Signature.t list; sender : Envelope.Sender.t }
Copy link
Member

Choose a reason for hiding this comment

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

here as well, fee payer key and nonce.

; ("diff", summary)
]
"exceeded capacity from $sender" ;
[%log debug] ~metadata "exceeded capacity from $sender" ;
Copy link
Member

Choose a reason for hiding this comment

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

I have used these logs a lot when debugging missed/lost transactions. I'd prefer if we can include at least fee payer part of a transaction.

[%log debug] "Verified diff: $verified_diff"
~metadata:
[ ( "verified_diff"
, Diff.verified_to_yojson
Copy link
Member

Choose a reason for hiding this comment

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

Same here

@georgeee
Copy link
Member Author

!ci-build-me

@georgeee
Copy link
Member Author

!ci-nightly-me

@georgeee
Copy link
Member Author

@deepthiskumar
Copy link
Member

!approved-for-mainnet

@georgeee georgeee merged commit f611438 into berkeley Sep 22, 2023
36 checks passed
@georgeee georgeee deleted the georgeee/remove-oversized-logs branch September 22, 2023 20:42
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.

None yet

4 participants