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

Contract deployments pollute the log #2742

Closed
nekonimous opened this issue Oct 22, 2024 · 2 comments · May be fixed by #3025
Closed

Contract deployments pollute the log #2742

nekonimous opened this issue Oct 22, 2024 · 2 comments · May be fixed by #3025
Assignees
Labels
fix:bug Something isn't working module:execution-core Issues related to execution-core type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc)

Comments

@nekonimous
Copy link

Summary

The node logs include the bytecode of contract deployments which is not only irritating but also makes it very hard to filter out the noise. Additionally, I'm not sure what the cap is regarding the bytecode size, so this potentially could also quickly fill up log space.

Not the full log, just a small snippet of it:

...
data: Some(Deploy(ContractDeploy { bytecode: ContractBytecode { hash: [220, 12, 238, 126, 34, 251, 82, 213, 19, 168, 223, 21, 167, 55, 184, 82, 41, 97, 225, 93, 6, 130, 195, 83, 12, 239, 132, 42, 166, 30, 75, 10], bytes: [0, 97, 115, 109, 1, 0, 0, 0, 1, 146, 1, 18, 96, 1, 127, 1, 127, 96, 2, 127, 127, 1, 127, 96, 1, 127, 0, 96, 3, 127, 127, 127, 1, 127, 96, 5, 127, 127, 127, 127, 126, 1, 127, 96, 4, 127, 127, 127, 127, 0, 96, 3, 127, 127, 127, 0, 96, 2, 127, 127, 0, 96, 0, 0, 96, 3, 126, 127, 127, 0, 96, 4, 126, 126, 127, 127, 1, 127, 96, 6, 127, 127, 127, 127, 127, 127, 1, 127, 96, 5, 127, 127, 127, 127, 127, 1, 127, 96, 7, 127, 127, 127, 127, 127, 127, 127, 1, 127, 96, 11, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 1, 127, 96, 15, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 1, 127, 96, 3, 126, 127, 127, 1, 127, 96, 5, 127, 126, 126, 126, 126, 0, 2, 9, 1, 3, 101, 110, 118, 1, 99, 0, 4, 3, 162, 1, 160, 1, 1, 0, 1, 1, 0, 1, 5, 5, 6, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 7, 0, 0, 0, 0, 0, 6, 2, 2, 1, 1, 5, 6, 6, 6, 1, 1, 1, 2, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 0, 0, 6, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 6, 6, 6, 7, 1, 3, 5, 1, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 0, 5, 8, 7, 9, 1, 10, 1, 1, 1, 1, 1, 1, 2, 6, 3, 11, 12, 3, 3, 1, 13, 14, 15, 12, 3, 3, 1, 1, 1, 0, 2, 12, 3, 1, 3, 1, 1, 16, 1, 1, 1, 6, 3, 3, 17, 3, 3, 4, 5, 1, 112, 1, 86, 86, 5, 3, 1, 0, 3, 6, 29, 4, 127, 1, 65, 128, 128, 4, 11, 127, 0, 65, 128, 176, 4, 11, 127, 0, 65, 200, 179, 8, 11, 127, 0, 65, 208, 179, 8, 11, 7, 114, 9, 6, 109, 101, 109, 111, 114, 121, 2, 0, 1, 65, 3, 1, 4, 112, 105, 110, 103, 0, 23, 8, 119, 105, 116, 104, 100, 114, 97, 119, 0, 24, 7, 100, 101, 112, 111, 115, 105, 116, 0, 25, 20, 99, 111, 110, 116, 114, 97, 99, 116, 95, 116, 111, 95, 99, 111, 110, 116, 114, 97, 99, 116, 0, 26, 19, 99, 111, 110, 116, 114, 97, 99, 116, 95, 116, 111, 95, 97, 99, 99, 111, 117, 110, 116, 0, 27, 10, 95, 95, 100, 97, 116, 97, 95, 101, 110, 100, 3, 2, 11, 95, 95, 104, 101, 97, 112, 95, 98, 97, 115, 101, 3, 3, 9, 98, 1, 0, 65, 1, 11, 85, 18, 84, 81, 87, 50, 38, 15, 17, 16, 14, 82, 83, 13, 80, 45, 77, 29, 21, 31, 19, 32, 30, 48, 11, 47, 40, 39, 12, 154, 1, 54, 59, 58, 53, 57, 56, 55, 60, 113, 37, 52, 44, 90, 78, 79, 51, 46, 49, 85, 86, 68, 74, 72, 67, 73, 71, 66, 70, 69, 64, 20, 75, 65, 63, 42, 43, 88, 89, 91, 10, 107, 109, 108, 111, 102, 104, 106, 110, 103, 150, 1, 126, 146, 1, 147, 1, 149, 1, 152, 1, 144, 1, 10, 214, 227, 2, 160, 1, 169, 6, 3, 5, 127, 1, 126, 1, 127, 35, 128, 128, 128, 128, 0, 65, 224, 0, 107, 34, 2, 36, 128, 128, 128, 128, 0, 2, 64, 2, 64, 2, 64, 32, 0, 40, 2, 0, 34, 3, 65, 129, 128, 4, 79, 13, 0, 32, 2, 65, 48, 106, 65, 196, 179, 136, 128, 0, 16, 189, 128, 128, 128, 0, 34, 0, 40, 2, 0, 34, 4, 32, 0, 40, 2, 4, 34, 0, 40, 2, 12, 17, 128, 128, 128, 128, 0, 0, 34, 5, 32, 5, 65, 32, 106, 32, 4, 32, 0, 40, 2, 16, 17, 128, 128, 128, 128, 0, 0, 16, 242, 128, 128, 128, 0, 65, 0, 33, 4, 32, 2, 65, 44, 106, 65, 0, 54, 2, 0, 32, 2, 65, 36, 106, 66, 0, 55, 2, 0, 32, 2, 65, 128, 128, 132, 128, 0, 54, 2, 32, 32, 2, 66, 128, 128, 128, 128, 112, 55, 3, 24, 32, 2, 65, 128, 176, 132, 128, 0, 54, 2, 16, 32, 2, 65, 128, 176, 132, 128, 0, 54, 2, 8, 32, 2, 32, 3, 54, 2, 12, 32, 2, 32, 3, 65, 128, 176, 132, 128, 0, 106, 34, 6, 54, 2, 20, 65, 2, 65, 1, 32, 3, 65, 56, 73, 34, 5, 27, 33, 0, 2, 64, 32, 5, 13, 0, 65, 0, 65, 128, 176, 132, 128, 0, 107, 65, 128, 176, 132, 128, 0, 113, 65, 8, 73, 13, 0, 65, 4, 33, 0, 2, 64, 32, 3, 65, 200, 175, 132, 128, 0, 106, 34, 3, 65, 7, 113, 69, 13, 0, 65, 0, 33, 4, 12, 1, 11, 65, 3, 33, 0, 2, 64, 32, 6, 32, 3, 107, 65, 56, 79, 13, 0, 65, 0, 33, 4, 12, 1, 11, 32, 2, 32, 3, 54, 2, 20, 32, 2, 65, 1, 54, 2, 24, 32, 2, 65, 208, 0, 106, 32, 3, 32, 2, 65, 8, 106, 16, 156, 128, 128, 128, 0, 2, 64, 32, 2, 40, 2, 80, 34, 0, 13, 0, 65, 7, 33, 0, 65, 0, 33, 4, 32, 2, 40, 2, 24, 65, 1, 71, 13, 1, 32, 2, 40, 2, 84, 33, 0, 32, 2, 65, 0, 54, 2, 24, 32, 2, 32, 6, 54, 2, 20, 32, 2, 32, 6, 54, 2, 16, 65, 1, 33, 4, 12, 1, 11, 65, 0, 33, 4, 11, 2, 64, 32, 2, 40, 2, 36, 34, 3, 69, 13, 0, 32, 2, 40, 2, 32, 32, 3, 65, 1, 106, 173, 66, 24, 126, 167, 34, 5, 107, 32, 3, 32, 5, 106, 65, 9, 106, 65, 8, 16, 228, 128, 128, 128, 0, 11, 32, 4, 69, 13, 0, 32, 0, 65, 44, 106, 40, 2, 0, 33, 6, 32, 0, 41, 3, 32, 33, 7, 65, 1, 33, 5, 65, 1, 33, 4, 2, 64, 32, 0, 45, 0, 47, 34, 3, 32, 0, 40, 2, 40, 32, 3, 192, 65, 127, 74, 34, 8, 27, 34, 3, 69, 13, 0, 32, 3, 65, 127, 76, 13, 2, 65, 0, 45, 0, 248, 175, 132, 128, 0, 26, 32, 3, 65, 1, 16, 227, 128, 128, 128, 0, 34, 4, 69, 13, 3, 11, 32, 4, 32, 0, 65, 40, 106, 65, 0, 32, 6, 32, 8, 27, 106, 32, 3, 16, 157, 129, 128, 128, 0, 33, 6, 2, 64, 32, 0, 65, 52, 106, 40, 2, 0, 34, 4, 69, 13, 0, 32, 4, 65, 0, 72, 13, 1, 32, 0, 40, 2, 48, 33, 8, 65, 0, 45, 0, 248, 175, 132, 128, 0, 26, 32, 4, 65, 1, 16, 227, 128, 128, 128, 0, 34, 5, 69, 13, 1, 32, 5, 32, 0, 65, 48, 106, 32, 8, 106, 32, 4, 16, 157, 129, 128, 128, 0, 26, 11, 32, 2, 65, 8, 106, 65, 24, 106, 32, 0, 65, 24, 106, 41, 3, 0, 55, 3, 0, 32, 2, 65, 8, 106, 65, 16, 106, 32, 0, 65, 16, 106, 41, 3, 0, 55, 3, 0, 32, 2, 65, 8, 106, 65, 8, 106, 32, 0, 65, 8, 106, 41, 3, 0, 55, 3, 0, 32, 2, 32, 4, 54, 2, 68, 32, 2, 32, 5, 54, 2, 64, 32, 2, 32, 4, 54, 2, 60, 32, 2, 32, 3, 54, 2, 56, 32, 2, 32, 6, 54, 2, 52, 32, 2, 32, 3, 54, 2, 48, 32, 2, 32, 7, 55, 3, 40, 32, 2, 32, 0, 41, 3, 0, 55, 3, 8, 65, 248, 175, 132, 128, 0, 32, 2, 65, 8, 106, 16, 150, 128, 128, 128, 0, 32, 2, 65, 224, 0, 106, 36, 128, 128, 128, 128, 0, 65, 0, 15, 11, 0, 0, 11, 16, 243, 128, 128, 128, 0, 0, 11, 65, 1, 32, 3, 16, 244, 128, 128, 128, 0, 0, 11, 212, 2, 1, 8, 127, 35, 128, 128, 128, 128, 0, 65, 176, 8, 107, 34, 1, 36, 128, 128, 128, 128, 0, 32, 1, 65, 0, 65, 128, 8, 16, 156, 129, 128, 128, 0, 34, 1, 65, 144, 8, 106, 65, 0, 54, 2, 0, 32, 1, 66, 128, 128, 4, 55, 2, 132, 8, 32, 1, 65, 128, 176, 132, 128, 0, 54, 2, 128, 8, 32, 1, 32, 1, 54, 2, 140, 8, 32, 0, 40, 2, 0, 33, 2, 2, 64, 2, 64, 2, 64, 2, 64, 32, 0, 40, 2, 144, 4, 69, 13, 0, 65, 1, 33, 3, 65, 128, 128, 4, 33, 4, 65, 0, 33, 5, 12, 1, 11, 32, 1, 65, 160, 8, 106, 32, 0, 65, 152, 4, 106, 40, 2, 0, 32, 0, 65, 156, 4, 106, 40, 2, 0, 32, 1, 65, 128, 8, 106, 16, 135, 128, 128, 128, 0, 32, 1, 40, 2, 160, 8, 65, 4, 71, 13, 1, 32, 1, 40, 2, 164, 8, 33, 6, 65, 0, 33, 3, 32, 1, 40, 2, 132, 8, 33, 4, 32, 1, 40, 2, 136, 8, 33, 5, 11, 32, 5, 65, 0, 32, 5, 107, 65, 7, 113, 34, 7, 106, 34, 8, 32, 4, 75, 13, 0, 32, 0, 40, 2, 200, 2, 33, 4, 32, 1, 40, 2, 128, 8, 32, 5, 106, 65, 0, 32, 7, 16, 156, 129, 128, 128, 0, 26, 32, 1, 32, 8, 54, 2, 136, 8, 32, 1, 32, 4, 65, 8, 116, 32, 2, 114, 54, 2, 156, 8, 32, 1, 32, 6, 54, 2, 152, 8, 32, 1, 32, 3, 54, 2, 148, 8, 32, 1, 65, 160, 8, 106, 32, 1, 65, 128, 8, 106, 32, 0, 32, 1, 65, 148, 8, 106, 16, 136, 128, 128, 128, 0, 32, 1, 40, 2, 160, 8, 69, 13, 1, 11, 0, 0, 11, 32, 1, 40, 2, 136, 8, 33, 0, 32, 1, 65, 176, 8, 106, 36, 128, 128, 128, 128, 0, 32, 0, 11, 148, 2, 1, 4, 127, 35, 128, 128, 128, 128, 0, 65, 32, 107, 34, 2, 36, 128, 128, 128, 128, 0, 2, 64, 32, 0,
...

Possible Solution (optional)

Please consider removing the bytecode from the logs (or truncate it or whatever), I don't think it's useful for node runners at all.

@HDauven HDauven added fix:bug Something isn't working type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc) module:execution-core Issues related to execution-core labels Nov 20, 2024
@d-sonuga
Copy link
Collaborator

To produce this issue, there are two points I found at which ContractBytecode can get logged at the warning or error level.
The error log is here and the warning log is here

For the error log:

msg.write(&mut encoded).map_err(|err| {
            error!("could not encode message {msg:?}: {err}");
            anyhow::anyhow!("failed to broadcast: {err}")
        })?;

msg.write makes several calls to io::Write::write_all. If an error is returned during contract deployment, then msg which will contain ContractBytecode will be logged.
To demonstrate this, the branch here intentionally ensures an error is encountered during msg.write for a Phoenix contract deployment. When this happens, the ContractBytecode is logged.

Screenshot 2024-11-20 at 16 21 57 Screenshot 2024-11-20 at 16 22 41

I did not reproduce the warning log but assumed the same thing will happen as in the error because it's the same situation.

@herr-seppia
Copy link
Member

Closing as obsolete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix:bug Something isn't working module:execution-core Issues related to execution-core type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants