Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save EclesioMeloJunior/ebc2895ae9252695dac0e4c17dc890d5 to your computer and use it in GitHub Desktop.
Save EclesioMeloJunior/ebc2895ae9252695dac0e4c17dc890d5 to your computer and use it in GitHub Desktop.
Gossamer runtime wasmer logs
2023-07-17T12:16:06-04:00 DEBUG target=runtime::inclusion-inherent message=[create_inherent_inner] bitfields.len(): 0, backed_candidates.len(): 0, disputes.len() 0 ext_logging_log_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:06-04:00 DEBUG key: 0x26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc ext_storage_get_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:06-04:00 DEBUG value: 0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a7 ext_storage_get_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:06-04:00 DEBUG data 0x0000000000000000000000000000000000000000000000000000000000000000007bec5f40ea02f4b1fa6a3b1b45a4fe7682ba84277267ff545e3ac5797bd2277e03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400 has hash 0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a7 ext_hashing_blake2_256_version_1 pkg=runtime module=go-wasmer
...
Now we can see that we entered in the `enter_inner` para_inherents pallet method using the correct header
2023-07-17T12:16:06-04:00 DEBUG data 0x0000000000000000000000000000000000000000000000000000000000000000007bec5f40ea02f4b1fa6a3b1b45a4fe7682ba84277267ff545e3ac5797bd2277e03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400 has hash 0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a7 ext_hashing_blake2_256_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:06-04:00 DEBUG target=runtime::inclusion-inherent message=[enter_inner] parent_header=0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a7 bitfields.len(): 0, backed_candidates.len(): 0, disputes.len(): 0 ext_logging_log_version_1 pkg=runtime module=go-wasmer
...
Now while applying the extrinsics, the same parent hash is used
2023-07-17T12:16:06-04:00 DEBUG data 0x0000000000000000000000000000000000000000000000000000000000000000007bec5f40ea02f4b1fa6a3b1b45a4fe7682ba84277267ff545e3ac5797bd2277e03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400 has hash 0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a7 ext_hashing_blake2_256_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:06-04:00 DEBUG target=runtime::inclusion-inherent message=[enter_inner] parent_header=0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a7 bitfields.len(): 0, backed_candidates.len(): 0, disputes.len(): 0 ext_logging_log_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:06-04:00 DEBUG key: 0x26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc ext_storage_get_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:06-04:00 DEBUG value: 0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a7 ext_storage_get_version_1 pkg=runtime module=go-wasmer
...
And then we build the block 1
2023-07-17T12:16:10-04:00 INFO built block 1 with hash 0x77d2ca4bd6c9fb35113aabe5b28f3da4cfc07b38233cabddda7f724f90e8e1d5, state root 0xd77aa7ed02b252efdd0768b56c68dd8ff6d4a4ad86adf869a01211793e0bdd9f, epoch 0 and slot 281601761 pkg=babe
...
Now we will try to produce the block number 2, first we call the `BlockBuilder_inherent_extrinsics`
we call the `create_inherent_inner` method from `para_inherents` pallet with success
and I can see that the key `0x26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc` holds the correct
value for the parent hash which is the hash of block 1
2023-07-17T12:16:12-04:00 DEBUG target=runtime::inclusion-inherent message=[create_inherent_inner] bitfields.len(): 0, backed_candidates.len(): 0, disputes.len() 0 ext_logging_log_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:12-04:00 DEBUG key: 0x26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc ext_storage_get_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:12-04:00 DEBUG value: 0x77d2ca4bd6c9fb35113aabe5b28f3da4cfc07b38233cabddda7f724f90e8e1d5 ext_storage_get_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:12-04:00 DEBUG data 0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a704d77aa7ed02b252efdd0768b56c68dd8ff6d4a4ad86adf869a01211793e0bdd9ff733f76a455b4caa245339ec8db3126e42df25ff18f5a5ffa0b740bcb04933c00c0642414245b5010300000000e1e6c81000000000b6c2ed9622d8acd957d1d221acae687859ec7784a36542b41e8ec308e342105d001fad53b249528e56502f24604d44c6985f54f401cf0bcb6a020da0cbb9fc02095120e902705f59a421c5d61be1de641e0d6fefa677159d963859bdec6b0806044241424529010104d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0100000000000000000000000000000000000000000000000000000000000000000000000000000005424142450101d8db5d60b78dcb26b44ffefb535ac38c7abbbaa7001e7f8be25083cd6f74ff3d7d921539ce5c55f69fa1877b91223d5ec37fba07f012cc00bbe37f4c45166984 has hash 0x77d2ca4bd6c9fb35113aabe5b28f3da4cfc07b38233cabddda7f724f90e8e1d5 ext_hashing_blake2_256_version_1 pkg=runtime module=go-wasmer
...
Now we call the `enter_inner` method from `para_inherents` pallet, the hash is correct
2023-07-17T12:16:12-04:00 DEBUG data 0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a704d77aa7ed02b252efdd0768b56c68dd8ff6d4a4ad86adf869a01211793e0bdd9ff733f76a455b4caa245339ec8db3126e42df25ff18f5a5ffa0b740bcb04933c00c0642414245b5010300000000e1e6c81000000000b6c2ed9622d8acd957d1d221acae687859ec7784a36542b41e8ec308e342105d001fad53b249528e56502f24604d44c6985f54f401cf0bcb6a020da0cbb9fc02095120e902705f59a421c5d61be1de641e0d6fefa677159d963859bdec6b0806044241424529010104d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0100000000000000000000000000000000000000000000000000000000000000000000000000000005424142450101d8db5d60b78dcb26b44ffefb535ac38c7abbbaa7001e7f8be25083cd6f74ff3d7d921539ce5c55f69fa1877b91223d5ec37fba07f012cc00bbe37f4c45166984 has hash 0x77d2ca4bd6c9fb35113aabe5b28f3da4cfc07b38233cabddda7f724f90e8e1d5 ext_hashing_blake2_256_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:12-04:00 DEBUG target=runtime::inclusion-inherent message=[enter_inner] parent_header=0x77d2ca4bd6c9fb35113aabe5b28f3da4cfc07b38233cabddda7f724f90e8e1d5 bitfields.len(): 0, backed_candidates.len(): 0, disputes.len(): 0 ext_logging_log_version_1 pkg=runtime module=go-wasmer
...
After the `BlockBuilder_inherent_extrinsics` we call the `BlockBuilder_apply_extrinsic` and here I think the problem exists.
The parent hash changes from `0x77d2ca4bd6c9fb35113aabe5b28f3da4cfc07b38233cabddda7f724f90e8e1d5` which is the correct hash
from block 1 to `0xfb0cf820badbcf6451effc8b6222c7564133d834f65a60e1d664a4d73fc248d4` which is a weird value taken from the
output of the line 45, and then it fails as it doesn't hold the validation at line
https://github.com/paritytech/polkadot/blob/ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25/runtime/parachains/src/paras_inherent/mod.rs#L327
2023-07-17T12:16:12-04:00 DEBUG data 0x7f56d9f6097a23ef474b211e33b55a75384f475067082bd23e75b985ccd0b0a704d77aa7ed02b252efdd0768b56c68dd8ff6d4a4ad86adf869a01211793e0bdd9ff733f76a455b4caa245339ec8db3126e42df25ff18f5a5ffa0b740bcb04933c00c0642414245b5010300000000e1e6c81000000000b6c2ed9622d8acd957d1d221acae687859ec7784a36542b41e8ec308e342105d001fad53b249528e56502f24604d44c6985f54f401cf0bcb6a020da0cbb9fc02095120e902705f59a421c508771600641e0d6fefa677159d963859bdec6b0806044241424529010104d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0100000000000000000000000000000000000000000000000000000000000000000000000000000005424142450101d8db5d60b78dcb26b44ffefb535ac38c7abbbaa7001e7f8be25083cd6f74ff3d7d921539ce5c55f69fa1877b91223d5ec37fba07f012cc00bbe37f4c45166984 has hash 0xfb0cf820badbcf6451effc8b6222c7564133d834f65a60e1d664a4d73fc248d4 ext_hashing_blake2_256_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:12-04:00 DEBUG target=runtime::inclusion-inherent message=[enter_inner] parent_header=0xfb0cf820badbcf6451effc8b6222c7564133d834f65a60e1d664a4d73fc248d4 bitfields.len(): 0, backed_candidates.len(): 0, disputes.len(): 0 ext_logging_log_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:12-04:00 DEBUG key: 0x26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc ext_storage_get_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:12-04:00 DEBUG value: 0x77d2ca4bd6c9fb35113aabe5b28f3da4cfc07b38233cabddda7f724f90e8e1d5 ext_storage_get_version_1 pkg=runtime module=go-wasmer
2023-07-17T12:16:12-04:00 WARN failed to handle slot 281601762: cannot build inherents: error applying inherent: transaction validity error: mandatory dispatch error pkg=babe
@EclesioMeloJunior
Copy link
Author

And if you compare the data value from the line 35 with the data value from line 45 you found few different bytes but this diff was not introduced by gossamer, does it?

@EclesioMeloJunior
Copy link
Author

data value from the line 35 (left) with the data value from line 45 (right)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment