-
Notifications
You must be signed in to change notification settings - Fork 60
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
node, node-data: truncate trace logs of contract deployments #3025
base: master
Are you sure you want to change the base?
Conversation
I understand that the contract byte-code and the transaction proof can pollute the output of the node-log. Since this is an issue with the |
0f52b5a
to
3e1c49b
Compare
…ing unneeded information
3e1c49b
to
bdf9460
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though that the originally issue were already solved by some @fed-franz PR
What are the logs that we're trying to truncate here?
I understood that they are related to the contract deployment, but I don't get which they are and how this PR would truncate them
fn variant_name(&self) -> &'static str { | ||
match self { | ||
Payload::Block(_) => "Block", | ||
Payload::Candidate(_) => "Candidate", | ||
Payload::Empty => "Empty", | ||
Payload::GetBlocks(_) => "GetBlocks", | ||
Payload::GetMempool(_) => "GetMempool", | ||
Payload::GetResource(_) => "GetResource", | ||
Payload::Inv(_) => "Inv", | ||
Payload::Quorum(_) => "Quorum", | ||
Payload::Ratification(_) => "Ratification", | ||
Payload::Transaction(_) => "Transaction", | ||
Payload::Validation(_) => "Validation", | ||
Payload::ValidationQuorum(_) => "ValidationQuorum", | ||
Payload::ValidationResult(_) => "ValidationResult", | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use msg.topic(), that implements Debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't seem to find a topic
function defined for node_data::message::Payload
.
@herr-seppia, the contract deployment holds a struct Message defined here and Payload defined here are structs which have chains of fields that result in a value possibly holding These structs are printed out here and here. This PR gets rid of this issue by avoiding the printing out of the entire struct which may contain |
There is no trace of ContractDeployment in your changes. The issue was created when the code was dumping the whole block (including transactions and optionally their contract deployment), but this has been changed by fed's pr Hence my question. |
@herr-seppia, yes I can replicate it. |
Perfect, can you post on the original issue how to? |
@herr-seppia, the replication is here. |
The branch you proposed is actually throwing an error on purpose everytime a transaction is broadcasted. ps: Having the whole message dumped if an encoding error happens LGTM, because it's a bug that needs investigation |
Okay, since that's the case, I guess the issue should be considered resolved already? |
To resolve the noisy log as described in #2742, the
ContractDeploy::bytecode
field now pretty prints asContractBytecode { ... }
and the Phoenix transaction'sproof
field now pretty prints as[ ... ]
.