AAC: Investigate ChainstateError::InvalidStracksBlocks(String)
As reported in this discussion https://github.com/stacks-network/stacks-core/pull/6531/files#r2389233969
append_block wraps ChainstateError variant types as String for the variant ChainstateError::InvalidStracksBlocks(String)
An example: https://github.com/stacks-network/stacks-core/blob/fe868ea6a1bf993793f1e09c3d397b5dde49b93d/stackslib/src/chainstate/nakamoto/mod.rs#L4612-L4618
To be understood if this is the right approach, or if it would be better to expose the native errors.
Potentially this kind of change could be consensus breaking.
The inner String is just to be an informative message. I don't think there are any consensus-critical code branches that depend on the message contents.
The inner
Stringis just to be an informative message. I don't think there are any consensus-critical code branches that depend on the message contents.
I think the bigger concern is that we may have consensus critical paths that match on ChainstateError::InvalidStacksBlock rather than ChainstateError::{Error type that was converted to a string and shoved into InvalidStacksBlock}
I.e. it is converting its own error type into itself but as a different variant and perhaps this is because of a code path that ONLY triggers for that specific converted type rather than the original.
Should probably complete https://github.com/stacks-network/stacks-core/issues/6597 before making any changes here.