You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In era we have a concept of system logs. These are used to pass information from L2 to L1 related to L2 state, including but not limited to pubdata commitment, hash of state diffs, log root, etc. The desire is to see these logs displayed in era test node similar to how console logs are displayed.
🤔 Rationale
Ensuring that these logs have the correct information helps us catch bugs early and gives us better insight into era.
🖼️ Mockups/Examples
System logs take on the form of each represented as bytes32 so displaying these 2 values similar to 2 bytes32 console logs would work.
An update on this feature request (as I attempted to get this working locally):
It appears that the call(...) made from the SystemContractHelper.toL1(...) function is not being returned in the Call Tracer we're using. I'm unsure why, but if it's not being returned then we'll need to make changes to the SystemContractHelper.sol to add some debug functionality
I've proven out that we could add a few console.log() and console.logBytes32() statements within toL1, however hardhat's console.sol contract does not allow for logging a single line of both string and byte32, so it would need to be separated by multiple lines. Example:
function toL1(bool_isService, bytes32_key, bytes32_value) internal {
console.log("[SYSTEM_LOG]");
console.logBytes32(_key);
console.logBytes32(_value);
09:59:15 INFO ==== Console logs:
09:59:15 INFO [SYSTEM_LOG]
09:59:15 INFO 0000000000000000000000000000000000000000000000000000000000000004
09:59:15 INFO 0000000000000000000000000000000000000000000000000000000000000000
Another approach we can take is to avoid using console.log() and use events or even a custom debug slot of memory similar to what we do with custom gas data from bootloader.yul. Example:
Then we can filter out this special Topic address and format it into a section something like below:
09:59:15 INFO ==== System logs:
09:59:15 INFO key: 0000000000000000000000000000000000000000000000000000000000000004
09:59:15 INFO value: 0000000000000000000000000000000000000000000000000000000000000000
09:59:15 INFO
09:59:15 INFO key: 0000000000000000000000000000000000000000000000000000000000000005
09:59:15 INFO value: 0000000000000000000000000000000000000000000000000000000000000000
09:59:15 INFO
09:59:15 INFO key: 0000000000000000000000000000000000000000000000000000000000000006
09:59:15 INFO value: 0000000000000000000000000000000000000000000000000000000000000000
🌟 Feature Request
📝 Description
In era we have a concept of system logs. These are used to pass information from L2 to L1 related to L2 state, including but not limited to pubdata commitment, hash of state diffs, log root, etc. The desire is to see these logs displayed in era test node similar to how console logs are displayed.
🤔 Rationale
Ensuring that these logs have the correct information helps us catch bugs early and gives us better insight into era.
🖼️ Mockups/Examples
System logs take on the form of each represented as
bytes32
so displaying these 2 values similar to 2 bytes32 console logs would work.📋 Additional Context
System logs are sent via this function
The text was updated successfully, but these errors were encountered: