-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: block production misbehavior detection #1071
Merged
Merged
Changes from 8 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
b42b2a8
include fraud checking
bf0e7eb
update test
c7939c7
first check on mockFraud Handler
7fb5faa
fraud check done
bb1ebfb
add fraud check on p2p layer
1bb5ffe
even received check
11c6703
fix tests
242863e
add validation for block timestamp fraud
07277e1
include test for block validation and fraud
2c147dd
include fraud test errors
a45ef32
fix tests
c58d16d
fix units
427abd7
remove generic handler
32fb103
fix linter
58cf2a8
reordering imports by hand
a9ca873
pr comments 1
4963924
fix pr suggestions
94923c0
Merge remote-tracking branch 'origin/main' into feat/adr-fraud-handling
b913735
move some packages
338ad82
Merge remote-tracking branch 'origin/main' into feat/adr-fraud-handling
cd804f3
remove unused file
835dcae
Merge branch 'feat/adr-fraud-handling' of github.com-faulty:dymension…
f88b299
export methods
48c862f
update comments
d54bdb3
Merge remote-tracking branch 'origin/main' into feat/adr-fraud-handling
e3ffab8
fix test
7ba65a8
fix linter
921ff1e
block height invalid, fraud
d5f89ef
update last block height comparison
a1a8d01
add last header block hash
c623b40
add validations
3378be8
add sequencer hash
465ef3f
Merge remote-tracking branch 'origin/main' into feat/adr-fraud-handling
99abc4e
include next sequencer hash
6408d12
include tmsignature validate
5191dda
linter
ec1a825
add missing lib
e5a767d
Merge remote-tracking branch 'origin/main' into feat/adr-fraud-handling
dec030c
add to state serialization
a978587
include param to last header hash to UpdateStateFromApp
1ae1c11
Add fraud handler to manager.
fc85b29
Fix units
806fc8c
solve some issues based on the PR comments
710f523
comment applyBlockWithFraudHandling
40e5f8b
remove comment
684c515
simplify apply block with block fraud handling
decd83e
cleanup the code and duplications on validate
e740570
update comments
ad473d1
expected heights
2e27ce7
updated fraud info
aa74bec
Merge remote-tracking branch 'origin/main' into feat/adr-fraud-handling
166ef41
update branch with validator set
adffd84
move err invalid signature fraud
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package block | ||
|
||
import ( | ||
"context" | ||
"github.com/dymensionxyz/dymint/node/events" | ||
uevent "github.com/dymensionxyz/dymint/utils/event" | ||
) | ||
|
||
type FreezeHandler struct { | ||
m *Manager | ||
} | ||
danwt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
func (f FreezeHandler) HandleFault(ctx context.Context, fault error) { | ||
uevent.MustPublish(context.TODO(), f.m.Pubsub, &events.DataHealthStatus{Error: fault}, events.HealthStatusList) | ||
faultytolly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
func NewFreezeHandler(manager *Manager) *FreezeHandler { | ||
return &FreezeHandler{ | ||
m: manager, | ||
} | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
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.
dont need
I
suffix in goThere 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.
and interfaces should be defined in consumer packageThere 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.
nvm it is already