-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor!: streamline OpBlockExecutionError
error type to replace a hard-coded BlockExecutionError
#13696
Open
chungquantin
wants to merge
15
commits into
paradigmxyz:main
Choose a base branch
from
chungquantin:chungquantin/refactor-op_block_execution_error
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
refactor!: streamline OpBlockExecutionError
error type to replace a hard-coded BlockExecutionError
#13696
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
3174d8e
refactor: add Eth variant to OpBlockExecutionError
chungquantin 998c226
refactor: BlockExecutionStrategyFactory
chungquantin 7bfd8a7
chore: init
chungquantin e21f7b6
Revert "chore: init"
chungquantin 0c74b82
refactor(partial): add BlockExecutionError to BlockExecutionProvider
chungquantin 214bd6b
refactor: add Eth variant to OpBlockExecutionError
chungquantin f1278f1
refactor: BlockExecutionStrategyFactory
chungquantin e7692dc
chore: init
chungquantin a36615f
Revert "chore: init"
chungquantin aace402
refactor(partial): add BlockExecutionError to BlockExecutionProvider
chungquantin d52148d
chore: rebase main
chungquantin 9cfe592
Merge branch 'chungquantin/refactor-op_block_execution_error' into ch…
chungquantin 5579b66
Merge pull request #2 from chungquantin/chungquantin/refactor-temp
chungquantin 63457a4
chore: remove blockchain-tree crate
chungquantin 9c8b898
refactor: add generic block execution error type to Stage
chungquantin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't panic here. the return type of this method must change to
Result<(ExecutionOutcome, Option<TrieUpdates>), E::Error>
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank for your suggestion. This is made on purpose for me to test my implementation. Currently I got blocked by the
validate_block_post_execution
that throwsConsensusError
. I am thinking adding the type constraintFrom<ConsensusError>
but it will lead to other issues.Edit: Currently got it resolved but still have a lot of things to consider for the overall design. e.g.
BlockErrorKind
acceptsBlockExecutionError
. Hence, we would either streaming and converting the error type back toBlockExecutionError
or redesignBlockErrorKind
to accept generic Error type.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great design ideas, let's choose
(i) add trait bound: From, then impl the conversion
From<ConsensusError> for OpBlockExecutionError
which would put the consensus error inside theOpBlockExecutionError::Eth
variant(ii) redesign
BlockErrorKind
to accept generic Error typeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire crate was actually removed, I think resolving merge conflicts with main will be the most productive thing to do here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Rjected! Rebased.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went further with the second option and seems like it is doable. Question for this approach would be which level of code that we want to convert back
OpBlockExecutionError -> BlockExecutionError
or we will streamline theOpBlockExecutionError
the whole way to theStage
API level?If the later is what we want, do you think it makes sense if
Provider
type can accept theError
type for block execution errors?