diff --git a/eth/tracers/js/internal/tracers/assets.go b/eth/tracers/js/internal/tracers/assets.go index 8c9ec8bc4f..604582ac50 100644 --- a/eth/tracers/js/internal/tracers/assets.go +++ b/eth/tracers/js/internal/tracers/assets.go @@ -5,7 +5,7 @@ // call_tracer_legacy.js (8.956kB) // evmdis_tracer.js (4.215kB) // opcount_tracer.js (1.372kB) -// prestate_tracer.js (4.287kB) +// prestate_tracer.js (4.469kB) // trigram_tracer.js (1.788kB) // unigram_tracer.js (1.469kB) @@ -176,7 +176,7 @@ func opcount_tracerJs() (*asset, error) { return a, nil } -var _prestate_tracerJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x57\xdd\x6f\xdb\x38\x12\x7f\xb6\xfe\x8a\x41\x5f\x6c\x5d\x5d\xb9\xcd\x02\x7b\x80\x73\x39\x40\x75\xdd\x36\x40\x36\x09\x6c\xe7\x72\xb9\xc5\x3e\x50\xe4\x48\xe6\x9a\x26\x05\x92\xb2\xe3\x2b\xf2\xbf\x1f\x86\xfa\xf0\x47\x93\xa6\x7b\x6f\x16\x39\xfc\xcd\xf7\x6f\xc6\xa3\x11\x4c\x4c\xb9\xb3\xb2\x58\x7a\x38\x7b\xff\xe1\xef\xb0\x58\x22\x14\xe6\x1d\xfa\x25\x5a\xac\xd6\x90\x56\x7e\x69\xac\x8b\x46\x23\x58\x2c\xa5\x83\x5c\x2a\x04\xe9\xa0\x64\xd6\x83\xc9\xc1\x9f\xc8\x2b\x99\x59\x66\x77\x49\x34\x1a\xd5\x6f\x9e\xbd\x26\x84\xdc\x22\x82\x33\xb9\xdf\x32\x8b\x63\xd8\x99\x0a\x38\xd3\x60\x51\x48\xe7\xad\xcc\x2a\x8f\x20\x3d\x30\x2d\x46\xc6\xc2\xda\x08\x99\xef\x08\x52\x7a\xa8\xb4\x40\x1b\x54\x7b\xb4\x6b\xd7\xda\xf1\xe5\xfa\x0e\xae\xd0\x39\xb4\xf0\x05\x35\x5a\xa6\xe0\xb6\xca\x94\xe4\x70\x25\x39\x6a\x87\xc0\x1c\x94\x74\xe2\x96\x28\x20\x0b\x70\xf4\xf0\x33\x99\x32\x6f\x4c\x81\xcf\xa6\xd2\x82\x79\x69\xf4\x10\x50\x92\xe5\xb0\x41\xeb\xa4\xd1\xf0\x4b\xab\xaa\x01\x1c\x82\xb1\x04\x32\x60\x9e\x1c\xb0\x60\x4a\x7a\x17\x03\xd3\x3b\x50\xcc\xef\x9f\xfe\x44\x40\xf6\x7e\x0b\x90\x3a\xa8\x59\x9a\x12\xc1\x2f\x99\x27\xaf\xb7\x52\x29\xc8\x10\x2a\x87\x79\xa5\x86\x84\x96\x55\x1e\xee\x2f\x17\x5f\x6f\xee\x16\x90\x5e\x3f\xc0\x7d\x3a\x9b\xa5\xd7\x8b\x87\x73\xd8\x4a\xbf\x34\x95\x07\xdc\x60\x0d\x25\xd7\xa5\x92\x28\x60\xcb\xac\x65\xda\xef\xc0\xe4\x84\xf0\xdb\x74\x36\xf9\x9a\x5e\x2f\xd2\x8f\x97\x57\x97\x8b\x07\x30\x16\x3e\x5f\x2e\xae\xa7\xf3\x39\x7c\xbe\x99\x41\x0a\xb7\xe9\x6c\x71\x39\xb9\xbb\x4a\x67\x70\x7b\x37\xbb\xbd\x99\x4f\x13\x98\x23\x59\x85\xf4\xfe\xf5\x98\xe7\x21\x7b\x16\x41\xa0\x67\x52\xb9\x36\x12\x0f\xa6\x02\xb7\x34\x95\x12\xb0\x64\x1b\x04\x8b\x1c\xe5\x06\x05\x30\xe0\xa6\xdc\xfd\x74\x52\x09\x8b\x29\xa3\x8b\xe0\xf3\x8b\x05\x09\x97\x39\x68\xe3\x87\xe0\x10\xe1\x1f\x4b\xef\xcb\xf1\x68\xb4\xdd\x6e\x93\x42\x57\x89\xb1\xc5\x48\xd5\x70\x6e\xf4\xcf\x24\x22\xcc\xd2\xa2\xf3\xcc\xe3\xc2\x32\x8e\x16\x4c\xe5\xcb\xca\x3b\x70\x55\x9e\x4b\x2e\x51\x7b\x90\x3a\x37\x76\x1d\x2a\x05\xbc\x01\x6e\x91\x79\x04\x06\xca\x70\xa6\x00\x1f\x91\x57\xe1\xae\x8e\x74\x28\x57\xcb\xb4\x63\x3c\x9c\xe6\xd6\xac\xc9\xd7\xca\x79\xfa\xe1\x1c\xae\x33\x85\x02\x0a\xd4\xe8\xa4\x83\x4c\x19\xbe\x4a\xa2\x6f\x51\xef\xc0\x18\xaa\x93\xe0\x61\x23\x14\x6a\x63\x8b\x7d\x8b\x90\x55\x52\x09\xa9\x8b\x24\xea\xb5\xd2\x63\xd0\x95\x52\xc3\x28\x40\x28\x63\x56\x55\x99\x72\x6e\xaa\x60\xfb\x9f\xc8\x7d\x0d\xe6\x4a\xe4\x32\xa7\xe2\x60\xdd\xad\x37\xe1\xaa\xd3\x6b\x32\x92\x4f\xa2\xde\x11\xcc\x18\xf2\x4a\x07\x77\x06\x4c\x08\x3b\x04\x91\xc5\xdf\xa2\x5e\x6f\xc3\x2c\x61\xc1\x05\x78\xf3\x15\x1f\xc3\x65\x7c\x1e\xf5\x7a\x32\x87\x81\x5f\x4a\x97\xb4\xc0\xbf\x33\xce\xff\x80\x8b\x8b\x8b\xd0\xd4\xb9\xd4\x28\x62\x20\x88\xde\x73\x62\xf5\x4d\x2f\x63\x8a\x69\x8e\x63\xe8\xbf\x7f\xec\xc3\x5b\x10\x59\x52\xa0\xff\x58\x9f\xd6\xca\x12\x6f\xe6\xde\x4a\x5d\x0c\x3e\xfc\x1a\x0f\xc3\x2b\x6d\xc2\x1b\x68\xc4\xaf\x4d\x27\x5c\xdf\x73\x23\xc2\x75\x63\x73\x2d\x35\x31\xa2\x11\x6a\xa4\x9c\x37\x96\x15\x38\x86\x6f\x4f\xf4\xfd\x44\x5e\x3d\x45\xbd\xa7\xa3\x28\xcf\x6b\xa1\x17\xa2\xdc\x40\x00\x6a\x6f\xbb\x3a\x2f\x24\x75\xea\x61\x02\x02\xde\x8f\x92\x30\x6f\x4d\x39\x49\xc2\x0a\x77\xaf\x67\x82\x2e\xa4\x78\xec\x2e\x56\xb8\x8b\xcf\xa3\x17\x53\x94\x34\x46\xff\x2e\xc5\xe3\xcf\xe6\xeb\xe4\xcd\x51\x5c\xe7\x24\xb5\xb7\x37\x8e\x4f\xe2\x68\xd1\x55\xca\x53\xb9\x4b\xbd\x31\x2b\x22\xae\x25\xc5\x47\xa9\x10\x12\x53\x52\xb6\x5c\xcd\x1c\x19\xa2\x06\xe9\xd1\x32\xa2\x4e\xb3\x41\x4b\x53\x03\x2c\xfa\xca\x6a\xd7\x85\x31\x97\x9a\xa9\x16\xb8\x89\xba\xb7\x8c\xd7\x3d\x53\x9f\x1f\xc4\x92\xfb\xc7\x10\xc5\xe0\xdd\x68\x04\xa9\x07\x72\x11\x4a\x23\xb5\x1f\xc2\x16\x41\x23\x0a\x6a\x7c\x81\xa2\xe2\x3e\xe0\xf5\x37\x4c\x55\xd8\xaf\x9b\x9b\x28\x32\x3c\x35\x15\x4d\x82\x83\xe6\x1f\x06\x03\xd7\x66\x13\x46\x5c\xc6\xf8\x0a\x9a\x86\x33\x56\x16\x52\x47\x4d\x38\x8f\x9a\x8d\x2c\x4a\x08\x38\x98\x15\x72\x45\x49\xa4\x93\x8f\x4c\xc1\x05\x64\xb2\xb8\xd4\xfe\x24\x79\x75\xd0\xdb\xa7\xf1\x1f\x49\xd3\x3c\x89\x23\xc2\x1b\x9c\xc5\x43\xf8\xf0\x6b\x57\x11\xde\x10\x14\xbc\x0e\xe6\xcd\xcb\x50\xd1\x69\x31\x3c\xff\x2c\xa8\xa1\x0e\x7e\x1b\xb4\x26\xae\xca\x28\x1d\xb5\x9f\x21\x8e\xc7\x5d\x7c\xfe\x03\xdc\x63\xdf\x5a\xdc\x26\x34\x09\x13\xe2\x10\x94\x3e\xc3\x77\xc1\xdc\x9d\x43\x01\x6f\x81\xbe\xa4\x26\x55\x4e\xf2\x2f\xcc\xc5\xf0\x37\x68\x24\x6e\xad\xe4\xdf\x59\x52\xe7\xf5\x13\x72\x8b\x6b\x1a\x05\x94\x3a\xce\x94\x42\xdb\x77\x10\x88\x66\xd8\xd4\x60\x48\x32\xae\x4b\xbf\x6b\x07\x84\x67\xb6\x40\xef\x5e\xf7\x26\xe0\xbc\x7b\xd7\xf2\x66\x88\xdf\xae\x44\xb8\xb8\x80\xfe\x64\x36\x4d\x17\xd3\x7e\xd3\x7b\xa3\x11\xdc\x63\x58\x9f\x32\x25\x33\xa1\x76\x20\x50\xa1\xc7\xda\x2e\xa3\x43\x5c\x3b\x1e\x19\xd2\x1e\x44\x1b\x0a\x3e\x4a\xe7\xa5\x2e\xa0\xa6\x97\x2d\x0d\xe3\x06\x2e\x34\x16\x67\x15\x85\xe7\x74\x72\x79\x43\x6b\x88\x45\x22\x23\x1a\x1a\xa1\x47\x99\x92\xdd\xda\x92\x4b\xeb\x3c\x94\x8a\x71\x4c\x08\xaf\x33\xe6\xe5\xa2\x68\xda\x9f\x54\xcf\x42\xdf\x06\xa0\xfd\x54\x64\x8a\xa6\x2a\xa9\x77\x30\x68\x31\xe2\xa8\xd7\xb3\xad\xf4\x01\xf6\xf9\x9e\x47\x9c\xc7\xf2\x90\x45\x68\x1b\xc1\x0d\x12\xef\x06\x0a\xa9\x27\x28\xe9\xfa\xd7\x6f\xcd\xc8\x46\x97\x44\x3d\x7a\x77\x40\x06\xca\x14\xc7\x64\x20\xea\xb0\xf0\xca\x5a\xca\x7f\xc7\xdb\x39\x11\xc3\x9f\x95\xf3\x14\x53\x4b\xe1\x69\x28\xe6\x39\x66\x0d\x3c\x4a\x23\x3a\xfe\x9e\x41\x69\xd8\x85\xe1\x42\xea\x9a\xd1\x56\xaf\x80\xa5\xf1\xa8\xbd\x64\x4a\xed\x28\x0f\x5b\x4b\xbb\x0f\x6d\x3b\x43\x70\x92\xa4\x02\x4d\x05\x51\xa9\xb9\xaa\x44\x5d\x06\xa1\xf8\x1b\x3c\x17\x6c\x3e\x5e\x9a\xd6\xe8\x1c\x2b\x30\xa1\x4a\xca\xe5\x63\xb3\x76\x6a\xe8\xd7\xcc\x38\x88\xfb\x49\x67\xe4\x31\x2f\x29\x53\x24\x6d\x91\x11\xb7\xa7\x42\x58\x74\x6e\x10\x37\x44\xd5\x65\xf6\x7e\x89\x9a\x82\x0f\x1a\xb7\xd0\xed\x33\x8c\x73\xda\xef\xc4\x10\x98\x10\xc4\x87\x27\xbb\x47\xd4\xeb\xb9\xad\xf4\x7c\x09\x41\x93\x29\xf7\xbd\x18\x37\xf5\xcf\x99\x43\x78\x33\xfd\xf7\x62\x72\xf3\x69\x3a\xb9\xb9\x7d\x78\x33\x86\xa3\xb3\xf9\xe5\x7f\xa6\xdd\xd9\xc7\xf4\x2a\xbd\x9e\x4c\xdf\x8c\xc3\x40\x7f\xc6\x21\x6f\x5a\x17\x48\xa1\xf3\x8c\xaf\x92\x12\x71\x35\x78\x7f\xcc\x03\x7b\x07\x7b\xbd\xcc\x22\x5b\x9d\xef\x8d\xa9\x1b\xb4\xd1\xd1\xf2\x34\x5c\xc0\x8b\xc1\x3a\x7f\xd9\x9a\x49\x23\x3f\x68\xd9\x7f\xbf\xbf\x04\xaa\x78\xdd\x8e\xb3\xbf\x6c\x48\xe8\x1d\xc6\x57\x63\x70\x4c\xd1\xda\x2c\xff\x4b\x7f\x77\xf2\xdc\xa1\x1f\x02\x6a\x61\xb6\xc4\x7c\x1d\x6a\x7d\xd3\xe0\x1e\x84\xec\x43\x5c\xd3\xee\x4d\x3e\x88\x3b\x61\x02\xfb\x5e\xf4\xec\x39\x51\xd4\x02\x2e\x5a\xf4\xb7\xe1\xe5\xeb\x81\x3a\x6b\x22\x75\xa2\xe0\x97\x93\xb5\x30\xdc\xaf\x71\x6d\xec\xae\x99\x61\x07\xfe\xfd\x38\xaa\xe9\xd5\x55\x57\x4f\xf4\x41\x45\xd6\x1d\x7c\x9a\x5e\x4d\xbf\xa4\x8b\xe9\x91\xd4\x7c\x91\x2e\x2e\x27\xf5\xd1\x5f\x2e\xbc\x0f\x3f\x5d\x78\xfd\xf9\x7c\x71\x33\x9b\xf6\xc7\xcd\xd7\xd5\x4d\xfa\xa9\xff\x9d\xc2\x66\x75\xfc\x51\xeb\x7a\x73\x6f\xac\xf8\x7f\x3a\xe0\x60\x8d\xcb\xd9\x73\x5b\x5c\xa0\x76\xee\xab\x93\x7f\x49\xc0\x74\xcb\xca\x79\xfd\x4f\xb1\x17\xde\x3f\xcb\xc3\x4f\xd1\x53\xf4\xbf\x00\x00\x00\xff\xff\x3a\xb7\x37\x41\xbf\x10\x00\x00") +var _prestate_tracerJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x57\x4d\x6f\x1b\x39\x12\x3d\xab\x7f\x45\x21\x17\x49\x1b\xa5\x15\x7b\x80\x59\x40\x5e\x2f\xd0\x51\x94\x44\x80\xc7\x36\x24\x79\xb3\xde\xc1\x1c\xd8\x64\x75\x8b\x23\x8a\x6c\x90\x6c\xc9\xda\xc0\xff\x7d\x51\xec\x0f\x7d\xc4\x8a\x33\xeb\x93\x9b\x2c\xbe\xaa\x7a\xac\x7a\x2c\x0d\x87\x30\x36\xc5\xce\xca\x7c\xe9\xe1\xf2\xfd\xc5\xdf\x61\xb1\x44\xc8\xcd\x3b\xf4\x4b\xb4\x58\xae\x21\x29\xfd\xd2\x58\x17\x0d\x87\xb0\x58\x4a\x07\x99\x54\x08\xd2\x41\xc1\xac\x07\x93\x81\x3f\xb1\x57\x32\xb5\xcc\xee\xe2\x68\x38\xac\xce\xbc\xb8\x4d\x08\x99\x45\x04\x67\x32\xbf\x65\x16\x47\xb0\x33\x25\x70\xa6\xc1\xa2\x90\xce\x5b\x99\x96\x1e\x41\x7a\x60\x5a\x0c\x8d\x85\xb5\x11\x32\xdb\x11\xa4\xf4\x50\x6a\x81\x36\xb8\xf6\x68\xd7\xae\x89\xe3\xf3\xed\x03\xdc\xa0\x73\x68\xe1\x33\x6a\xb4\x4c\xc1\x7d\x99\x2a\xc9\xe1\x46\x72\xd4\x0e\x81\x39\x28\x68\xc5\x2d\x51\x40\x1a\xe0\xe8\xe0\x27\x0a\x65\x5e\x87\x02\x9f\x4c\xa9\x05\xf3\xd2\xe8\x01\xa0\xa4\xc8\x61\x83\xd6\x49\xa3\xe1\x97\xc6\x55\x0d\x38\x00\x63\x09\xa4\xc7\x3c\x25\x60\xc1\x14\x74\xae\x0f\x4c\xef\x40\x31\xbf\x3f\xfa\x13\x84\xec\xf3\x16\x20\x75\x70\xb3\x34\x05\x82\x5f\x32\x4f\x59\x6f\xa5\x52\x90\x22\x94\x0e\xb3\x52\x0d\x08\x2d\x2d\x3d\x7c\x9d\x2e\xbe\xdc\x3d\x2c\x20\xb9\x7d\x84\xaf\xc9\x6c\x96\xdc\x2e\x1e\xaf\x60\x2b\xfd\xd2\x94\x1e\x70\x83\x15\x94\x5c\x17\x4a\xa2\x80\x2d\xb3\x96\x69\xbf\x03\x93\x11\xc2\x6f\x93\xd9\xf8\x4b\x72\xbb\x48\x3e\x4c\x6f\xa6\x8b\x47\x30\x16\x3e\x4d\x17\xb7\x93\xf9\x1c\x3e\xdd\xcd\x20\x81\xfb\x64\xb6\x98\x8e\x1f\x6e\x92\x19\xdc\x3f\xcc\xee\xef\xe6\x93\x18\xe6\x48\x51\x21\x9d\x7f\x9d\xf3\x2c\xdc\x9e\x45\x10\xe8\x99\x54\xae\x61\xe2\xd1\x94\xe0\x96\xa6\x54\x02\x96\x6c\x83\x60\x91\xa3\xdc\xa0\x00\x06\xdc\x14\xbb\x9f\xbe\x54\xc2\x62\xca\xe8\x3c\xe4\x7c\xb6\x20\x61\x9a\x81\x36\x7e\x00\x0e\x11\xfe\xb1\xf4\xbe\x18\x0d\x87\xdb\xed\x36\xce\x75\x19\x1b\x9b\x0f\x55\x05\xe7\x86\xff\x8c\x23\xc2\x2c\x2c\x3a\xcf\x3c\x2e\x2c\xe3\x68\xc1\x94\xbe\x28\xbd\x03\x57\x66\x99\xe4\x12\xb5\x07\xa9\x33\x63\xd7\xa1\x52\xc0\x1b\xe0\x16\x99\x47\x60\xa0\x0c\x67\x0a\xf0\x09\x79\x19\xf6\x2a\xa6\x43\xb9\x5a\xa6\x1d\xe3\x61\x35\xb3\x66\x4d\xb9\x96\xce\xd3\x3f\xce\xe1\x3a\x55\x28\x20\x47\x8d\x4e\x3a\x48\x95\xe1\xab\x38\xfa\x16\x75\x0e\x82\xa1\x3a\x09\x19\xd6\x46\xa1\x36\xb6\xd8\xb5\x08\x69\x29\x95\x90\x3a\x8f\xa3\x4e\x63\x3d\x02\x5d\x2a\x35\x88\x02\x84\x32\x66\x55\x16\x09\xe7\xa6\x0c\xb1\xff\x89\xdc\x57\x60\xae\x40\x2e\x33\x2a\x0e\xd6\xee\x7a\x13\xb6\x5a\xbf\x26\x25\xfb\x38\xea\x1c\xc1\x8c\x20\x2b\x75\x48\xa7\xc7\x84\xb0\x03\x10\x69\xff\x5b\xd4\xe9\x6c\x98\x25\x2c\xb8\x06\x6f\xbe\xe0\x53\xd8\xec\x5f\x45\x9d\x8e\xcc\xa0\xe7\x97\xd2\xc5\x0d\xf0\xef\x8c\xf3\x3f\xe0\xfa\xfa\x3a\x34\x75\x26\x35\x8a\x3e\x10\x44\xe7\x25\xb3\x6a\xa7\x93\x32\xc5\x34\xc7\x11\x74\xdf\x3f\x75\xe1\x2d\x88\x34\xce\xd1\x7f\xa8\x56\x2b\x67\xb1\x37\x73\x6f\xa5\xce\x7b\x17\xbf\xf6\x07\xe1\x94\x36\xe1\x0c\xd4\xe6\xb7\xa6\x35\xae\xf6\xb9\x11\x61\xbb\x8e\xb9\xb2\x1a\x1b\x51\x1b\xd5\x56\xce\x1b\xcb\x72\x1c\xc1\xb7\x67\xfa\x7e\xa6\xac\x9e\xa3\xce\xf3\x11\xcb\xf3\xca\xe8\x0c\xcb\x35\x04\xa0\xf6\xb6\xad\xf3\x5c\x52\xa7\x1e\x5e\x40\xc0\xfb\xd1\x25\xcc\x9b\x50\x4e\x2e\x61\x85\xbb\xd7\x6f\x82\x36\xa4\x78\x6a\x37\x56\xb8\xeb\x5f\x45\x67\xaf\x28\xae\x83\xfe\x5d\x8a\xa7\x9f\xbd\xaf\x93\x33\x47\xbc\xce\xc9\x6a\x1f\x6f\xbf\x7f\xc2\xa3\x45\x57\x2a\x4f\xe5\x2e\xf5\xc6\xac\x48\xb8\x96\xc4\x8f\x52\x81\x12\x53\xd0\x6d\xb9\x4a\x39\x52\x44\x0d\xd2\xa3\x65\x24\x9d\x66\x83\x96\x5e\x0d\xb0\xe8\x4b\xab\x5d\x4b\x63\x26\x35\x53\x0d\x70\xcd\xba\xb7\x8c\x57\x3d\x53\xad\x1f\x70\xc9\xfd\x53\x60\x11\xbe\x45\x50\xff\x7d\x47\x4d\x20\x82\x7a\xec\x25\x0e\xa8\x5c\x43\x79\x50\x00\xd3\x0c\xfc\x53\xe8\x5e\x92\x80\x0c\xed\x3b\xa3\xd5\x6e\x10\x82\xb0\xc8\x65\x11\x14\xa5\xbe\xfe\xfa\xcc\x92\x39\xdd\xf5\x55\x7a\x85\x29\x4a\x7a\x50\x44\xdc\xfa\x39\xea\x44\x0a\x37\xf6\x26\x44\x5c\x51\x19\x05\x8c\xc4\x03\x19\x43\x61\xa4\xf6\x03\xd8\x22\x68\x44\x41\x72\x25\x50\x94\xdc\x87\x00\xba\x1b\xa6\x4a\xec\x56\x92\x44\xc2\x1e\x8e\x9a\x92\xde\xaf\x03\xc9\x1a\x04\x5a\xd7\x66\x13\x1e\xe6\x94\xf1\x15\xd4\x32\x61\xac\xcc\xa5\x8e\xce\x06\x46\xc0\x75\x68\x75\xe9\xd1\xca\x07\xa6\xe0\x1a\x52\x99\x4f\xb5\x3f\x29\xb9\xaa\x54\x9a\xa3\xfd\x3f\xe2\xba\xe5\x63\x47\x32\xdd\xbb\xec\x0f\xe0\xe2\xd7\xb6\x8e\xbd\x21\x28\x78\x1d\xcc\x9b\xf3\x50\xd1\x69\x09\xbf\x7c\x2c\xb8\x21\xdd\x79\x1b\xbc\xc6\xae\x4c\xa9\x88\xaa\x3c\x03\x8f\xc7\xda\x73\xf5\x03\xdc\xe3\xdc\x1a\xdc\x9a\x9a\x98\x09\x71\x08\x4a\x9f\xe1\x3b\x67\xee\xc1\xa1\x80\xb7\x40\x5f\x52\x93\x2b\x27\xf9\x67\xe6\xfa\xf0\x37\xa8\x2d\xee\xad\xe4\xdf\x45\x52\xdd\xeb\x47\xe4\x16\xd7\x54\x6e\x74\x75\x9c\x29\x85\xb6\xeb\x20\xc8\xe3\xa0\xee\x9c\x70\xc9\xb8\x2e\xfc\xae\x79\xd6\x3c\xb3\x39\x7a\xf7\x7a\x36\x01\xe7\xdd\xbb\x46\xed\x03\x7f\xbb\x82\x5a\x05\xba\xe3\xd9\x24\x59\x4c\xba\x75\xb7\x0c\x87\xf0\x15\xc3\xd0\x97\x2a\x99\x0a\xb5\x03\x81\x0a\x3d\x56\x71\x19\x1d\x78\x6d\xd5\x6f\x40\xd3\x1b\xcd\x55\xf8\x24\x9d\x97\x3a\x87\xaa\xcb\xb6\x34\x42\xb4\x1d\xb3\x21\xc0\x92\xe8\x39\x7d\x6f\xbd\xa1\xe1\xc9\x22\x49\x28\x3d\x75\x41\x59\x98\x92\xed\xb0\x95\x49\xeb\x3c\x14\x8a\x71\x0c\x4d\xd6\x06\x73\xbe\x28\x6a\xd1\x22\xd7\xb3\xa0\x36\x01\x68\xff\x96\x33\x45\xb3\x00\xb9\x77\xd0\x6b\x30\xfa\x51\xa7\x63\x1b\xeb\x03\xec\xab\xbd\xfa\x39\x8f\xc5\xa1\xf6\xd1\x0c\x85\x1b\xa4\xd7\x22\x08\x5f\xf5\xee\x93\xaf\x7f\xfd\x56\x0f\x1a\xe8\xe2\xa8\x43\xe7\x0e\x24\x4c\x99\xbc\x91\xb0\x4a\x0c\x44\x45\x0b\x2f\xad\x3d\x90\x1b\xd2\xb5\x2d\xc2\x9f\xa5\xf3\xc4\xa9\x25\x7a\x6a\x61\x7c\xe9\x3d\xd8\x8b\xde\x2b\x9a\x57\x3f\xc8\xd5\xe0\x5a\x18\x8f\xda\x4b\xa6\xd4\x8e\xee\x61\x6b\x69\x62\xa3\x19\x6d\x00\x4e\x92\x55\x90\xa9\x60\x2a\x35\x57\xa5\xa8\xca\x20\x14\x7f\x8d\xe7\x42\xcc\xc7\xa3\xde\x1a\x9d\x63\x39\xc6\x54\x49\x99\x7c\xaa\x87\x65\x0d\xdd\x4a\xcf\x7b\xfd\xee\x39\xc1\x54\x26\x8f\x9b\x22\xa3\x17\x29\x11\xc2\xa2\x73\xbd\xfe\x81\x86\x56\x35\xba\x44\x4d\xe4\x83\xc6\x2d\xb4\x53\x18\xe3\x9c\xa6\x52\x31\x00\x26\x04\xe9\xe1\xc9\xc4\x14\x75\x3a\x6e\x2b\x3d\x5f\x42\xf0\x64\x8a\x7d\x2f\xf6\xeb\xfa\xe7\xcc\x21\xbc\x99\xfc\x7b\x31\xbe\xfb\x38\x19\xdf\xdd\x3f\xbe\x19\xc1\xd1\xda\x7c\xfa\x9f\x49\xbb\xf6\x21\xb9\x49\x6e\xc7\x93\x37\xa3\x30\x86\xbc\x90\x90\x37\x4d\x0a\xe4\xd0\x79\xc6\x57\x71\x81\xb8\xea\xbd\x3f\xd6\x81\x7d\x82\x9d\x4e\x6a\x91\xad\xae\xf6\xc1\x54\x0d\x5a\xfb\x68\x74\x1a\xae\xe1\x2c\x59\x57\xe7\xa3\x19\xd7\xf6\xbd\x46\xfd\xf7\x53\x57\x90\x8a\xd7\xe3\xb8\xfc\xcb\x81\x84\xde\x61\x7c\x35\x02\xc7\x14\x0d\xfb\xf2\xbf\xf4\x23\x2d\xcb\x1c\xfa\x01\xa0\x16\x66\x4b\xca\xd7\xa2\x56\x3b\x35\xee\x01\x65\x17\xfd\x4a\x76\xef\xb2\x5e\xbf\x35\x26\xb0\xef\x4d\x2f\x5f\x32\x45\x2d\xe0\xba\x41\x7f\x1b\x4e\xbe\x4e\xd4\x65\xcd\xd4\x89\x83\x5f\x4e\x86\xd9\xb0\xbf\xc6\xb5\xb1\xbb\xfa\x0d\x3b\xc8\xef\xc7\xac\x26\x37\x37\x6d\x3d\xd1\x07\x15\x59\xbb\xf0\x71\x72\x33\xf9\x9c\x2c\x26\x47\x56\xf3\x45\xb2\x98\x8e\xab\xa5\xbf\x5c\x78\x17\x3f\x5d\x78\xdd\xf9\x7c\x71\x37\x9b\x74\x47\xf5\xd7\xcd\x5d\xf2\xb1\xfb\x9d\xc3\x7a\xe0\xfd\x51\xeb\x7a\xf3\xd5\x58\xf1\xff\x74\xc0\xc1\xf0\x99\xb1\x97\x66\xcf\x20\xed\xdc\x97\x27\xbf\xed\x80\xe9\x46\x95\xb3\xea\xf7\x6d\x27\x9c\x7f\x51\x87\x9f\xa3\xe7\xe8\x7f\x01\x00\x00\xff\xff\x8f\x1a\xa4\x61\x75\x11\x00\x00") func prestate_tracerJsBytes() ([]byte, error) { return bindataRead( @@ -192,7 +192,7 @@ func prestate_tracerJs() (*asset, error) { } info := bindataFileInfo{name: "prestate_tracer.js", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd4, 0x9, 0xf9, 0x44, 0x13, 0x31, 0x89, 0xf7, 0x35, 0x9a, 0xc6, 0xf0, 0x86, 0x9d, 0xb2, 0xe3, 0x57, 0xe2, 0xc0, 0xde, 0xc9, 0x3a, 0x4c, 0x4a, 0x94, 0x90, 0xa5, 0x92, 0x2f, 0xbf, 0xc0, 0xb8}} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7d, 0xa4, 0xbe, 0xcd, 0xf4, 0xfa, 0x67, 0x53, 0x96, 0x41, 0x8d, 0x38, 0xd2, 0xb3, 0x1, 0x14, 0x18, 0x59, 0x3d, 0x14, 0xe8, 0xa4, 0x98, 0xee, 0xd4, 0xba, 0xde, 0x1d, 0xb2, 0x9, 0x43, 0xd4}} return a, nil } diff --git a/eth/tracers/js/internal/tracers/prestate_tracer.js b/eth/tracers/js/internal/tracers/prestate_tracer.js index 084c04ec46..22d6628f88 100644 --- a/eth/tracers/js/internal/tracers/prestate_tracer.js +++ b/eth/tracers/js/internal/tracers/prestate_tracer.js @@ -47,6 +47,13 @@ // result is invoked when all the opcodes have been iterated over and returns // the final result of the tracing. result: function(ctx, db) { + if (this.prestate === null) { + this.prestate = {}; + // If tx is transfer-only, the recipient account + // hasn't been populated. + this.lookupAccount(ctx.to, db); + } + // At this point, we need to deduct the 'value' from the // outer transaction, and move it back to the origin this.lookupAccount(ctx.from, db); @@ -79,7 +86,7 @@ } // Whenever new state is accessed, add it to the prestate switch (log.op.toString()) { - case "EXTCODECOPY": case "EXTCODESIZE": case "BALANCE": + case "EXTCODECOPY": case "EXTCODESIZE": case "EXTCODEHASH": case "BALANCE": this.lookupAccount(toAddress(log.stack.peek(0).toString(16)), db); break; case "CREATE": diff --git a/eth/tracers/native/prestate.go b/eth/tracers/native/prestate.go new file mode 100644 index 0000000000..9655589df0 --- /dev/null +++ b/eth/tracers/native/prestate.go @@ -0,0 +1,186 @@ +// Copyright 2022 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package native + +import ( + "encoding/json" + "math/big" + "sync/atomic" + "time" + + "github.com/XinFinOrg/XDPoSChain/common" + "github.com/XinFinOrg/XDPoSChain/common/hexutil" + "github.com/XinFinOrg/XDPoSChain/core" + "github.com/XinFinOrg/XDPoSChain/core/vm" + "github.com/XinFinOrg/XDPoSChain/crypto" + "github.com/XinFinOrg/XDPoSChain/eth/tracers" +) + +func init() { + register("nativePrestateTracer", newPrestateTracer) +} + +type prestate = map[common.Address]*account +type account struct { + Balance string `json:"balance"` + Nonce uint64 `json:"nonce"` + Code string `json:"code"` + Storage map[common.Hash]common.Hash `json:"storage"` +} + +type prestateTracer struct { + env *vm.EVM + prestate prestate + create bool + to common.Address + interrupt uint32 // Atomic flag to signal execution interruption + reason error // Textual reason for the interruption +} + +func newPrestateTracer(ctx *tracers.Context, _ json.RawMessage) (tracers.Tracer, error) { + // First callframe contains tx context info + // and is populated on start and end. + return &prestateTracer{prestate: prestate{}}, nil +} + +// CaptureStart implements the EVMLogger interface to initialize the tracing operation. +func (t *prestateTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) { + t.env = env + t.create = create + t.to = to + + // Compute intrinsic gas + isHomestead := env.ChainConfig().IsHomestead(env.Context.BlockNumber) + isIstanbul := env.ChainConfig().IsIstanbul(env.Context.BlockNumber) + intrinsicGas, err := core.IntrinsicGas(input, nil, create, isHomestead, isIstanbul) + if err != nil { + return + } + + t.lookupAccount(from) + t.lookupAccount(to) + + // The recipient balance includes the value transferred. + toBal := hexutil.MustDecodeBig(t.prestate[to].Balance) + toBal = new(big.Int).Sub(toBal, value) + t.prestate[to].Balance = hexutil.EncodeBig(toBal) + + // The sender balance is after reducing: value, gasLimit, intrinsicGas. + // We need to re-add them to get the pre-tx balance. + fromBal := hexutil.MustDecodeBig(t.prestate[from].Balance) + gasPrice := env.TxContext.GasPrice + consumedGas := new(big.Int).Mul( + gasPrice, + new(big.Int).Add( + new(big.Int).SetUint64(intrinsicGas), + new(big.Int).SetUint64(gas), + ), + ) + fromBal.Add(fromBal, new(big.Int).Add(value, consumedGas)) + t.prestate[from].Balance = hexutil.EncodeBig(fromBal) + t.prestate[from].Nonce-- +} + +// CaptureEnd is called after the call finishes to finalize the tracing. +func (t *prestateTracer) CaptureEnd(output []byte, gasUsed uint64, _ time.Duration, err error) { + if t.create { + // Exclude created contract. + delete(t.prestate, t.to) + } +} + +// CaptureState implements the EVMLogger interface to trace a single step of VM execution. +func (t *prestateTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error) { + stack := scope.Stack + stackData := stack.Data() + stackLen := len(stackData) + switch { + case stackLen >= 1 && (op == vm.SLOAD || op == vm.SSTORE): + slot := common.Hash(stackData[stackLen-1].Bytes32()) + t.lookupStorage(scope.Contract.Address(), slot) + case stackLen >= 1 && (op == vm.EXTCODECOPY || op == vm.EXTCODEHASH || op == vm.EXTCODESIZE || op == vm.BALANCE || op == vm.SELFDESTRUCT): + addr := common.Address(stackData[stackLen-1].Bytes20()) + t.lookupAccount(addr) + case stackLen >= 5 && (op == vm.DELEGATECALL || op == vm.CALL || op == vm.STATICCALL || op == vm.CALLCODE): + addr := common.Address(stackData[stackLen-2].Bytes20()) + t.lookupAccount(addr) + case op == vm.CREATE: + addr := scope.Contract.Address() + nonce := t.env.StateDB.GetNonce(addr) + t.lookupAccount(crypto.CreateAddress(addr, nonce)) + case stackLen >= 4 && op == vm.CREATE2: + offset := stackData[stackLen-2] + size := stackData[stackLen-3] + init := scope.Memory.GetCopy(int64(offset.Uint64()), int64(size.Uint64())) + inithash := crypto.Keccak256(init) + salt := stackData[stackLen-4] + t.lookupAccount(crypto.CreateAddress2(scope.Contract.Address(), salt.Bytes32(), inithash)) + } +} + +// CaptureFault implements the EVMLogger interface to trace an execution fault. +func (t *prestateTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, _ *vm.ScopeContext, depth int, err error) { +} + +// CaptureEnter is called when EVM enters a new scope (via call, create or selfdestruct). +func (t *prestateTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) { +} + +// CaptureExit is called when EVM exits a scope, even if the scope didn't +// execute any code. +func (t *prestateTracer) CaptureExit(output []byte, gasUsed uint64, err error) { +} + +// GetResult returns the json-encoded nested list of call traces, and any +// error arising from the encoding or forceful termination (via `Stop`). +func (t *prestateTracer) GetResult() (json.RawMessage, error) { + res, err := json.Marshal(t.prestate) + if err != nil { + return nil, err + } + return json.RawMessage(res), t.reason +} + +// Stop terminates execution of the tracer at the first opportune moment. +func (t *prestateTracer) Stop(err error) { + t.reason = err + atomic.StoreUint32(&t.interrupt, 1) +} + +// lookupAccount fetches details of an account and adds it to the prestate +// if it doesn't exist there. +func (t *prestateTracer) lookupAccount(addr common.Address) { + if _, ok := t.prestate[addr]; ok { + return + } + t.prestate[addr] = &account{ + Balance: bigToHex(t.env.StateDB.GetBalance(addr)), + Nonce: t.env.StateDB.GetNonce(addr), + Code: bytesToHex(t.env.StateDB.GetCode(addr)), + Storage: make(map[common.Hash]common.Hash), + } +} + +// lookupStorage fetches the requested storage slot and adds +// it to the prestate of the given contract. It assumes `lookupAccount` +// has been performed on the contract before. +func (t *prestateTracer) lookupStorage(addr common.Address, key common.Hash) { + if _, ok := t.prestate[addr].Storage[key]; ok { + return + } + t.prestate[addr].Storage[key] = t.env.StateDB.GetState(addr, key) +}