-
Notifications
You must be signed in to change notification settings - Fork 464
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
[NIT-2479] - pathdb support for full nodes #2324
Conversation
f06ff8e
to
3a21f0f
Compare
f4d49dd
to
c3c8e88
Compare
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 work! I left some comments, mainly considering tests. We still need to discuss StateHistory
default value.
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.
LGTM pending resolving @magicxyyz's comments.
I didn't know this area of the code well before so it was interesting to read through it.
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.
still a lot left to review.. but look in my comments about defaults for testing
c3c8e88
to
6610db5
Compare
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.
I am still for inlining the unique errors instead of defining new variables, but we might need a third opinion to resolve that.
Otherwise looks good :)
6610db5
to
7e031ee
Compare
7e031ee
to
eb4df87
Compare
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.
Good job.
Small comments + Mostly need to solve conflicts vs the builder.
util/env/env.go
Outdated
|
||
// There are two CI steps, one to run tests using the path state scheme, and one to run tests using the hash state scheme. | ||
// An environment variable controls that behavior. | ||
func GetTestStateScheme() string { |
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.
this function is only used for testing, so fits better in a "testhelpers" package (could be testhelpers/env.. but probably not worth it)
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.
I moved to "github.com/offchainlabs/nitro/util/testhelpers/env" package.
It will be not straightforward to move this file to be part of the "github.com/offchainlabs/nitro/util/testhelpers" package.
replay depends indirectly on testhelpers, and GetTestStateScheme indirectly depends on "github.com/gofrs/flock".
wasm doens't support some syscalls required by flock:
~/Documents/offchain/git/nitro pathdb_fullnode⇣⇡* ❯ make test-go 52s
mkdir -p `dirname [target/machines/latest/replay.wasm](http://target/machines/latest/replay.wasm)`
GOOS=wasip1 GOARCH=wasm go build -o [target/machines/latest/replay.wasm](http://target/machines/latest/replay.wasm) ./cmd/replay/...
# [github.com/gofrs/flock](http://github.com/gofrs/flock)
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:28:30: undefined: syscall.LOCK_EX
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:39:30: undefined: syscall.LOCK_SH
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:57:20: undefined: syscall.Flock
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:67:20: undefined: syscall.Flock
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:97:20: undefined: syscall.Flock
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:97:50: undefined: syscall.LOCK_UN
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:119:29: undefined: syscall.LOCK_EX
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:131:29: undefined: syscall.LOCK_SH
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:151:17: undefined: syscall.Flock
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:151:52: undefined: syscall.LOCK_NB
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:151:52: too many errors
# [github.com/syndtr/goleveldb/leveldb/storage](http://github.com/syndtr/goleveldb/leveldb/storage)
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/syndtr/[email protected]/leveldb/storage/file_storage.go:107:16: undefined: newFileLock
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/syndtr/[email protected]/leveldb/storage/file_storage.go:192:3: undefined: rename
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/syndtr/[email protected]/leveldb/storage/file_storage.go:267:12: undefined: rename
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/syndtr/[email protected]/leveldb/storage/file_storage.go:272:12: undefined: syncDir
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/syndtr/[email protected]/leveldb/storage/file_storage.go:555:9: undefined: rename
/home/diego/.gvm/pkgsets/go1.21/global/pkg/mod/github.com/syndtr/[email protected]/leveldb/storage/file_storage.go:591:13: undefined: syncDir
make: *** [Makefile:273: [target/machines/latest/replay.wasm](http://target/machines/latest/replay.wasm)] Error 1
6273c13
to
69c6593
Compare
69c6593
to
5736c56
Compare
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.
LGTM
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.
LGTM
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.
LGTM
pathdb support for full nodes.
There are two steps for running tests default tests and race tests, one to run with HashScheme, and other with PathScheme.
Nodes gracefully shutdown if the provided scheme is not compatible with stored scheme: