Starting from 0.6.3, sourcemaps seem to have less information, at least around reverts statements.
Given this input.json:
{
"language": "Solidity",
"sources": {
"c.sol": {
"content": "pragma solidity ^0.6.0;\n\ncontract C {\n function test() public {\n revert();\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"debug": {},
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers"
],
"": [
"id",
"ast"
]
}
}
}
}
Compiling it with 0.6.2 and getting deployedBytecode.sourceMap for c.sol gives this:
25:59:0:-:0;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;25:59:0;;;;;;;;;;;;;;;;;;;40:42;;;:::i;:::-;;;69:8;;
While compiling with 0.6.3 (or 0.6.8; the result is the same) results in this:
25:59:0:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;25:59:0;;;;;;;;;;;;;;;;12:1:-1;9;2:12;40:42:0;;;:::i;:::-;;;12:1:-1;9;2:12
Notice that there's no mapping for the revert() statement: in the first sourcemap that's given by 69:8, but there's nothing like that in the second one.
This is due to the revert having become an internal routine. I will create a fix that reduces the source references for these internal routines altogether.
So to clarify, this is information that won't come back, right?
After #9029, it should be similar to how it was before 0.6.3.
Oh, got it, thanks :+1:
cc @alcuadrado
Will the fix be released in 0.6.9?
Do you have an intuition of what's going on here? Can we, for example, assume that the unmapped chunk is the translation of the expression that follows the latest mapped one?
Most helpful comment
After #9029, it should be similar to how it was before 0.6.3.