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

Execution service 2: separate execution from validation #1536

Merged
merged 89 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
1e4e052
Merge branch 'execution_separation_initial' into execution-separate-o…
tsahee Jan 31, 2023
56eccdc
Merge branch 'execution_separation_initial' into execution-separate-o…
tsahee Jan 31, 2023
fae1f0f
containers: add syncmap
tsahee Feb 10, 2023
86a734e
stopwaiter: optimize iterative 0-time call
tsahee Feb 10, 2023
3438753
initial separation of execution from validation
tsahee Feb 10, 2023
48afd4b
tracker: add information for AccumulatorNotFound
tsahee Feb 14, 2023
fb465a1
notfy block recorder of reorgs
tsahee Feb 14, 2023
03afe10
validateResult api fixes
tsahee Feb 15, 2023
93da3b6
arbnode: small fixes
tsahee Feb 15, 2023
7b44435
block_validator sorting and fixes
tsahee Feb 16, 2023
7d2aeac
validator prints logs
tsahee Feb 16, 2023
ed05af0
staker: more fixes
tsahee Feb 18, 2023
ad5dce9
validator node in system tests
tsahee Feb 21, 2023
d7776fe
blockvalidator tests: multiple txs in batch
tsahee Feb 21, 2023
d1a60e5
validation fixes
tsahee Feb 22, 2023
19bc3e9
Merge branch 'execution_separation_initial' into execution-separate-o…
tsahee Mar 1, 2023
1a0c8b5
Merge branch 'execution_separation_initial' into execution-separate-o…
tsahee Mar 1, 2023
01141e3
Merge branch 'execution_separation_initial' into execution-separate-o…
tsahee Mar 3, 2023
796cb6a
fix challenges FindGlobalStateFromMessageCount
tsahee Mar 6, 2023
be93c1c
stateless_block_validator: use recorder interface
tsahee Mar 6, 2023
31ffc5c
validation_mock improvements
tsahee Mar 6, 2023
30eac54
full challenge test: add mocks for various pos-in-batch
tsahee Mar 6, 2023
eca1bc0
Merge branch 'execution_separation_initial' into execution-separate-o…
tsahee Mar 8, 2023
69a3f66
testChallenge: fix parallelism
tsahee Mar 25, 2023
f43c5a1
dont run MockChallenge tests with race detection
tsahee Mar 26, 2023
2bf8aa0
Merge commit '82b4a521d5faa8811fcd8dfb1f0ccf0d90c5fe64' into executio…
tsahee Mar 30, 2023
71d9dcb
Merge branch 'execution_separation_initial' into execution-separate-o…
tsahee Mar 30, 2023
6f99d95
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee Apr 19, 2023
d6cefc7
merge fixes
tsahee Apr 19, 2023
d31155c
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee Apr 24, 2023
07ad509
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee Apr 24, 2023
9b5f184
fix block_validator test
tsahee Apr 24, 2023
3acf70a
block_validator: more detailed trace logs
tsahee Apr 25, 2023
6a24459
support prooving empty genesis block
tsahee Apr 25, 2023
71bc246
staker tests: use empty genesis
tsahee Apr 26, 2023
66219ff
seq_coordinator: only take over if all blocks were built
tsahee Apr 29, 2023
0cbd8c7
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee Apr 29, 2023
7a1a7b3
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee May 8, 2023
329611e
Merge branch 'test_stakers_fix' into execution-separate-over-valiation
tsahee May 8, 2023
2fea784
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee May 11, 2023
25d6c2e
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee May 26, 2023
78ff09c
fix block_recording for new arbos
tsahee May 26, 2023
97db673
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee Jun 14, 2023
472fec0
fix merge errors
tsahee Jun 14, 2023
f5a189b
block_validator: simplify preparing record
tsahee Jun 23, 2023
2bd6ac6
block_validator: iterative print validated
tsahee Jun 23, 2023
6ea61f7
fix typos and some renaming
tsahee Jun 23, 2023
60e9822
make reorg-to-block an init option
tsahee Jun 23, 2023
e1e6cda
renames and comment fixes
tsahee Jun 23, 2023
c1994bb
fix GlobalPositionAtCount
tsahee Jun 23, 2023
11689fd
l1_validator fixes
tsahee Jun 26, 2023
ab70066
block validator: support legacy lastValidated db
tsahee Jun 26, 2023
ce29aae
warn when catchin up to last valid
tsahee Jun 26, 2023
a20f5ba
validated not caught up if there is legacy information
tsahee Jun 27, 2023
e82d93d
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee Jun 28, 2023
2dc39a9
fix merge errors
tsahee Jun 28, 2023
37f9fb8
stop node even if start errored
tsahee Jun 28, 2023
86ed5e2
update geth
tsahee Jun 28, 2023
60e9dfb
geth: go back to origin/master
tsahee Jun 29, 2023
2887b77
Revert "fix merge errors"
tsahee Jun 29, 2023
4369b27
l1_validator: add nil check
tsahee Jun 29, 2023
aa767ea
staker: regularly check latest staked
tsahee Jun 29, 2023
0a1d789
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee Jun 29, 2023
63f7063
batch_validator: fix messages when not caught up
tsahee Jun 29, 2023
789f21f
validation: manage room in client and not server
tsahee Jun 30, 2023
ebbc572
block_validator: call launch in main thread
tsahee Jun 30, 2023
74cffb1
Merge pull request #1728 from OffchainLabs/validation_count_client
PlasmaPower Jun 30, 2023
e96d779
pruner: deleteFromRange return uint64
tsahee Jun 30, 2023
18e8365
message pruner updates
tsahee Jun 30, 2023
63df5ae
message_pruner: min-batches-left
tsahee Jun 30, 2023
c09cd9e
pruner: fix config options
tsahee Jun 30, 2023
e193ac0
calliterativelywith: avoid overhead for duration 0
tsahee Jul 6, 2023
9c435ac
Merge branch 'execution-separate-over-valiation' into pruner_fixes
tsahee Jul 6, 2023
947f8f7
CallIterativelyWith: fix trigger val if duration is 0
tsahee Jul 6, 2023
5b18e37
message pruner: fix bug checking if enough batches left
tsahee Jul 6, 2023
89fda39
pruner: minor fixes following review comments
tsahee Jul 6, 2023
e7030af
staker: move block_validator into notifiers
tsahee Jul 6, 2023
b56c734
update geth, add recordingDb config
tsahee Jul 7, 2023
0f3eb15
message_pruner: dont prune batchmetadata
tsahee Jul 7, 2023
3b91538
validator: dont warn when catching up
tsahee Jul 7, 2023
7465846
Merge branch 'pruner_fixes' into recordingdb_features
tsahee Jul 7, 2023
9be0397
block_validator bugfix: delete validation entry when done
tsahee Jul 7, 2023
b9b400a
Merge pull request #1732 from OffchainLabs/pruner_fixes
tsahee Jul 10, 2023
e61465a
Merge pull request #1741 from OffchainLabs/recordingdb_features
tsahee Jul 10, 2023
a2bcb67
Merge pull request #1747 from OffchainLabs/pruner_fixes
tsahee Jul 10, 2023
266948d
block_validator: don't try to read non-existing batch
tsahee Jul 10, 2023
67af3b3
block_validator: fixin PR review comments
tsahee Jul 10, 2023
314bd0c
Merge remote-tracking branch 'origin/master' into execution-separate-…
tsahee Jul 10, 2023
902f2ee
block_validator: add missing error check
tsahee Jul 10, 2023
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
40 changes: 14 additions & 26 deletions arbnode/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,17 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"
"github.com/offchainlabs/nitro/arbutil"
"github.com/offchainlabs/nitro/staker"
"github.com/offchainlabs/nitro/validator"
)

type BlockValidatorAPI struct {
val *staker.BlockValidator
}

func (a *BlockValidatorAPI) LatestValidatedBlock(ctx context.Context) (hexutil.Uint64, error) {
block := a.val.LastBlockValidated()
return hexutil.Uint64(block), nil
}

func (a *BlockValidatorAPI) LatestValidatedBlockHash(ctx context.Context) (common.Hash, error) {
_, hash, _ := a.val.LastBlockValidatedAndHash()
return hash, nil
func (a *BlockValidatorAPI) LatestValidated(ctx context.Context) (*staker.GlobalStateValidatedInfo, error) {
return a.val.ReadLastValidatedInfo()
PlasmaPower marked this conversation as resolved.
Show resolved Hide resolved
}

type BlockValidatorDebugAPI struct {
Expand All @@ -34,25 +28,16 @@ type BlockValidatorDebugAPI struct {
}

type ValidateBlockResult struct {
Valid bool `json:"valid"`
Latency string `json:"latency"`
Valid bool `json:"valid"`
Latency string `json:"latency"`
GlobalState validator.GoGlobalState `json:"globalstate"`
}

func (a *BlockValidatorDebugAPI) ValidateBlock(
ctx context.Context, blockNum rpc.BlockNumber, full bool, moduleRootOptional *common.Hash,
func (a *BlockValidatorDebugAPI) ValidateMessageNumber(
ctx context.Context, msgNum hexutil.Uint64, full bool, moduleRootOptional *common.Hash,
) (ValidateBlockResult, error) {
result := ValidateBlockResult{}

if blockNum < 0 {
return result, errors.New("this method only accepts absolute block numbers")
}
header := a.blockchain.GetHeaderByNumber(uint64(blockNum))
if header == nil {
return result, errors.New("block not found")
}
if !a.blockchain.Config().IsArbitrumNitro(header.Number) {
return result, types.ErrUseFallback
}
var moduleRoot common.Hash
if moduleRootOptional != nil {
moduleRoot = *moduleRootOptional
Expand All @@ -64,8 +49,11 @@ func (a *BlockValidatorDebugAPI) ValidateBlock(
moduleRoot = moduleRoots[0]
}
start_time := time.Now()
valid, err := a.val.ValidateBlock(ctx, header, full, moduleRoot)
result.Valid = valid
valid, gs, err := a.val.ValidateResult(ctx, arbutil.MessageIndex(msgNum), full, moduleRoot)
result.Latency = fmt.Sprintf("%vms", time.Since(start_time).Milliseconds())
if gs != nil {
result.GlobalState = *gs
}
result.Valid = valid
return result, err
}
Loading
Loading