1

How would one go about validating the data from the block header of a return data value action? It seems like a cool feature, but you'd need a full history node to validate wouldn't you?

https://github.com/EOSIO/eos/releases/tag/v2.1.0

1 Answer 1

1

In block header, you can find action_mroot. action_mroot is the root hash of merkle tree of action_receipts. action_receipt contains act_digest, and act_digest is constructed by hashing action itself and action_return_value.

You can validate action_return_value by comparing the hash value (of action and its return value) and act_digest in action receipt.

// eos/libraries/chain/apply_context.cpp

act_digest = generate_action_digest(
  [this](const char* data, uint32_t datalen) {
    return trx_context.hash_with_checktime<digest_type>(data, datalen);
  },
  *act,
  action_return_value // here
);

Your Answer

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

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