-
Notifications
You must be signed in to change notification settings - Fork 81
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
soroban-cli: outputting long noisy host events without verbose mode enabled #918
Comments
From a user perspective, I think this should be logged at the debug level by specifying |
Doing a recent test and this still appears to be the case, especially on error. It's pretty difficult to read the meaningful diagnostic logs on an invocation that has failed. Example:
|
This is also still the case in successful invocations: $ soroban contract invoke --id CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC -- transfer --from GBTBT26GIZWQO2FRPU6NCMTVHX4F3P2KYZWVZDNRFYIPAV323ODV7HZV --to CDZMTQGMYJC2MGF5WOYJXDUSVTYIYCW4FK5HXJAO5NCWABXL4J5U6XSA --amount 1
2024-03-21T04:36:48.081460Z INFO soroban_cli::log::diagnostic_event: 0: DiagnosticEvent {
in_successful_contract_call: true,
event: ContractEvent {
ext: V0,
contract_id: Some(
Hash(d7928b72c2703ccfeaf7eb9ff4ef4d504a55a8b979fc9b450ea2c842b4d1ce61),
),
type_: Contract,
body: V0(
ContractEventV0 {
topics: VecM(
[
Symbol(
ScSymbol(
StringM(transfer),
),
),
Address(
Account(
AccountId(
PublicKeyTypeEd25519(
Uint256(6619ebc6466d0768b17d3cd132753df85dbf4ac66d5c8db12e10f0577adb875f),
),
),
),
),
Address(
Contract(
Hash(f2c9c0ccc245a618bdb3b09b8e92acf08c0adc2aba7ba40eeb456006ebe27b4f),
),
),
String(
ScString(
StringM(native),
),
),
],
),
data: I128(
Int128Parts {
hi: 0,
lo: 1,
},
),
},
),
},
} I think we should change this output to be the JSON representation, which would look like this: {
"ext": "v0",
"contract_id": "d7928b72c2703ccfeaf7eb9ff4ef4d504a55a8b979fc9b450ea2c842b4d1ce61",
"type_": "contract",
"body": {
"v0": {
"topics": [
{
"symbol": "transfer"
},
{
"address": "GBTBT26GIZWQO2FRPU6NCMTVHX4F3P2KYZWVZDNRFYIPAV323ODV7HZV"
},
{
"address": "CDZMTQGMYJC2MGF5WOYJXDUSVTYIYCW4FK5HXJAO5NCWABXL4J5U6XSA"
},
{
"string": "native"
}
],
"data": {
"i128": {
"hi": 0,
"lo": 1
}
}
}
}
} |
What version are you using?
What did you do?
❯ soroban contract invoke --wasm ../rs-soroban-sdk/target/wasm32-unknown-unknown/release/test_add_u64.wasm --id 1 -- add --a 1 --b 2
What did you expect to see?
3
What did you see instead?
Discussion
This seems like possibly a bug, such as we're logging something at the wrong level, or not distinguishing between contract events vs host events when deciding to log at the info level.
However, this might also not be a bug and it might be working as intended. I'm not sure.
The text was updated successfully, but these errors were encountered: