Skip to content
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

Update BOLD state provider for overflow assertions #2201

Merged
merged 43 commits into from
Mar 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
992a30a
Update BOLD state provider for overflow assertions
PlasmaPower Mar 22, 2024
a0f607c
Merge branch 'sepolia-tooling-merge' into overflow-assertions-state-p…
PlasmaPower Mar 23, 2024
1114526
Merge branch 'sepolia-tooling-merge' into overflow-assertions-state-p…
PlasmaPower Mar 26, 2024
8cc83e6
update bold
rauljordan Mar 26, 2024
f6aa184
many chal levels
rauljordan Mar 26, 2024
175bf8f
test to check for challenge win
rauljordan Mar 27, 2024
d4b39c9
add in test fixes and lint
rauljordan Mar 27, 2024
7612671
update bold commit
rauljordan Mar 27, 2024
d84fed7
tag
rauljordan Mar 27, 2024
de8f91c
edited
rauljordan Mar 27, 2024
f766cab
bold ref
rauljordan Mar 27, 2024
0aebf14
trying to fix
rauljordan Mar 27, 2024
22ec174
test edit
rauljordan Mar 27, 2024
ab39b5a
config test
rauljordan Mar 27, 2024
6b7e642
test fix
rauljordan Mar 27, 2024
11117b4
lint
rauljordan Mar 27, 2024
8593f5f
lint
rauljordan Mar 27, 2024
aa0af74
db path
rauljordan Mar 27, 2024
a7ca863
lint
rauljordan Mar 27, 2024
315132f
revamp
rauljordan Mar 27, 2024
c8f2a04
support history commit in assertions
rauljordan Mar 27, 2024
abbc2f8
test
rauljordan Mar 27, 2024
a46caf7
add hist commit
rauljordan Mar 27, 2024
bdcd5d9
challenge test run
rauljordan Mar 27, 2024
9e3be32
para
rauljordan Mar 27, 2024
1d5c3c7
add log
rauljordan Mar 27, 2024
16927dc
more checks
rauljordan Mar 27, 2024
74a93c4
rev
rauljordan Mar 27, 2024
3d69fc4
flakey with bold
rauljordan Mar 27, 2024
614c719
add bold
rauljordan Mar 27, 2024
f815e04
hist commit
rauljordan Mar 27, 2024
ee5d1e4
rem
rauljordan Mar 27, 2024
8a25e9e
commit edit
rauljordan Mar 27, 2024
0ac8cb0
fix up
rauljordan Mar 27, 2024
568285d
Increase challenge tests timeout to 30m
PlasmaPower Mar 27, 2024
2542157
Fix TestChallengeProtocolBOLD shutdown
PlasmaPower Mar 27, 2024
f5deb86
test check
rauljordan Mar 28, 2024
061bb89
build tag
rauljordan Mar 28, 2024
ed69007
unskip test with fix
amsanghi Mar 28, 2024
86fddb2
Merge branch 'sepolia-tooling-merge' into overflow-assertions-state-p…
amsanghi Mar 28, 2024
17a9d02
Add back FindBatchContainingMessageIndex, was removed in the nitro la…
amsanghi Mar 28, 2024
e037379
unskip more test
amsanghi Mar 28, 2024
a459cb8
unskip more test
amsanghi Mar 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions staker/stateless_block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,39 @@ func GlobalStatePositionsAtCount(
return startPos, GlobalStatePosition{batch, posInBatch + 1}, nil
}

func FindBatchContainingMessageIndex(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function just exists somewhere else now. We should look around for it to make sure we aren't duplicating code.

tracker InboxTrackerInterface, pos arbutil.MessageIndex, high uint64,
) (uint64, error) {
var low uint64
// Iteration preconditions:
// - high >= low
// - msgCount(low - 1) <= pos implies low <= target
// - msgCount(high) > pos implies high >= target
// Therefore, if low == high, then low == high == target
for high > low {
// Due to integer rounding, mid >= low && mid < high
mid := (low + high) / 2
count, err := tracker.GetBatchMessageCount(mid)
if err != nil {
return 0, err
}
if count < pos {
// Must narrow as mid >= low, therefore mid + 1 > low, therefore newLow > oldLow
// Keeps low precondition as msgCount(mid) < pos
low = mid + 1
} else if count == pos {
return mid + 1, nil
} else if count == pos+1 || mid == low { // implied: count > pos
return mid, nil
} else { // implied: count > pos + 1
// Must narrow as mid < high, therefore newHigh < lowHigh
// Keeps high precondition as msgCount(mid) > pos
high = mid
}
}
return low, nil
}

type ValidationEntryStage uint32

const (
Expand Down
Loading