3

The IncomingBlock struct has a field called indexed_body, containing a Vec<Vec<u8>>. As far as I can tell this is sometimes sent with a block, although only when specifically requested. If received in such a situation, the data is (afaict) put directly in the database, without any verification – common and aura import queues pass it on without checking, so does Client and later BlockImportOperation, so either the DB has some constraints or I missed something. There are methods to get it out of the DB, but they are mostly used to answer these requests.

My questions are:

  1. What is this used for? Is it possible that we don't use this in our chain?
  2. If we don't use it, is it safe to always ignore this field, i.e. never send it and discard if received?
  3. Does this really never get validated during import? If so, isn't there a possibility of filling someone's DB with junk through this mechanism?

1 Answer 1

1

What is this used for? Is it possible that we don't use this in our chain?

Yes, you probably. It was added was part of implementing support for storage chains: 7688, 9171 and others. Your chain is very likely not using this functionality. Best to read into these prs to get some understanding. AFAIK this code is currently not being used by someone actively.

If we don't use it, is it safe to always ignore this field, i.e. never send it and discard if received?

Yes

Does this really never get validated during import? If so, isn't there a possibility of filling someone's DB with junk through this mechanism?

indexed_body: if request.fields.contains(BlockAttributes::INDEXED_BODY) {
    Some(block_data.indexed_body)
} else {
    None
},

You can find this code here. It basically discards the data if the node didn't requested it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.