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

feat: GC #2735

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3f1ad44
save
petar-dambovaliev Aug 27, 2024
a9e6fb7
save
petar-dambovaliev Aug 27, 2024
55ef154
save
petar-dambovaliev Aug 28, 2024
bc0029c
save
petar-dambovaliev Aug 28, 2024
5fa3bea
save
petar-dambovaliev Aug 29, 2024
d722c41
save
petar-dambovaliev Sep 1, 2024
f034259
save
petar-dambovaliev Sep 1, 2024
ed8bd0d
save
petar-dambovaliev Sep 2, 2024
1ffd83a
save
petar-dambovaliev Sep 2, 2024
190e578
save
petar-dambovaliev Sep 3, 2024
caf4d8c
save
petar-dambovaliev Sep 3, 2024
3812c2d
save
petar-dambovaliev Sep 3, 2024
743aefe
save
petar-dambovaliev Sep 3, 2024
8311005
save
petar-dambovaliev Sep 3, 2024
6d3e597
save
petar-dambovaliev Sep 3, 2024
fa01cad
save
petar-dambovaliev Sep 3, 2024
ae50064
save
petar-dambovaliev Sep 3, 2024
2d4481f
save
petar-dambovaliev Sep 3, 2024
fc59ac3
save
petar-dambovaliev Sep 4, 2024
31bd5f7
save
petar-dambovaliev Sep 4, 2024
e80199a
save
petar-dambovaliev Sep 5, 2024
8a9e66e
Merge branch 'master' into sgc
petar-dambovaliev Sep 5, 2024
b7061e1
save
petar-dambovaliev Sep 5, 2024
653d997
save
petar-dambovaliev Sep 5, 2024
4b7813f
save
petar-dambovaliev Sep 7, 2024
d079cec
Merge branch 'master' into sgc
petar-dambovaliev Sep 7, 2024
359ccd5
save
petar-dambovaliev Sep 7, 2024
75c3f85
save
petar-dambovaliev Sep 7, 2024
a72515e
save
petar-dambovaliev Sep 7, 2024
4e81ac6
save
petar-dambovaliev Sep 9, 2024
f0f1922
save
petar-dambovaliev Sep 9, 2024
157169f
save
petar-dambovaliev Sep 9, 2024
e3b1dd1
save
petar-dambovaliev Sep 9, 2024
889a069
save
petar-dambovaliev Sep 9, 2024
7df8bb5
save
petar-dambovaliev Sep 10, 2024
ad94edb
save
petar-dambovaliev Sep 10, 2024
ee7d91a
Merge branch 'master' into sgc
petar-dambovaliev Sep 10, 2024
0231b42
save
petar-dambovaliev Sep 10, 2024
96b5b05
save
petar-dambovaliev Sep 28, 2024
675aee6
Merge branch 'master' into sgc
petar-dambovaliev Sep 28, 2024
6f3ebce
Update gnovm/pkg/gnolang/gc_test.go
petar-dambovaliev Sep 29, 2024
34df31f
save
petar-dambovaliev Sep 29, 2024
5f76cd1
save
petar-dambovaliev Sep 29, 2024
21ec3a4
save
petar-dambovaliev Sep 29, 2024
b5f0c14
save
petar-dambovaliev Sep 29, 2024
479e94d
save
petar-dambovaliev Sep 29, 2024
e9c9b87
save
petar-dambovaliev Sep 29, 2024
8b4d3a8
save
petar-dambovaliev Sep 30, 2024
d2f7ef0
save
petar-dambovaliev Sep 30, 2024
1138695
save
petar-dambovaliev Sep 30, 2024
23753f9
save
petar-dambovaliev Sep 30, 2024
72af342
save
petar-dambovaliev Sep 30, 2024
fb1dae0
save
petar-dambovaliev Sep 30, 2024
95c6351
Merge branch 'master' into sgc
petar-dambovaliev Oct 1, 2024
cb2eab8
Merge branch 'master' into sgc
petar-dambovaliev Oct 2, 2024
61ea82c
Merge branch 'master' into sgc
petar-dambovaliev Oct 16, 2024
6e9e1ec
Update gnovm/pkg/gnolang/alloc.go
petar-dambovaliev Oct 16, 2024
8325344
save
petar-dambovaliev Oct 16, 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
7 changes: 7 additions & 0 deletions contribs/gnodev/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ require (
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.6.0 // indirect
Expand All @@ -65,6 +66,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
Expand All @@ -76,14 +78,19 @@ require (
github.com/peterbourgon/ff/v3 v3.4.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/shirou/gopsutil/v4 v4.24.8 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/yuin/goldmark v1.5.4 // indirect
github.com/yuin/goldmark-emoji v1.0.2 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.11 // indirect
Expand Down
19 changes: 19 additions & 0 deletions contribs/gnodev/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions contribs/gnokeykc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,27 @@ require (
github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/peterbourgon/ff/v3 v3.4.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/shirou/gopsutil/v4 v4.24.8 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.opentelemetry.io/otel v1.29.0 // indirect
Expand Down
19 changes: 19 additions & 0 deletions contribs/gnokeykc/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/gno.land/p/demo/avl/z_0_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ func main() {
// "RefCount": "2"
// },
// "Parent": null,
// "Roots": null,
// "Source": {
// "@type": "/gno.RefNode",
// "BlockNode": null,
Expand Down
1 change: 1 addition & 0 deletions examples/gno.land/p/demo/avl/z_1_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ func main() {
// "RefCount": "2"
// },
// "Parent": null,
// "Roots": null,
// "Source": {
// "@type": "/gno.RefNode",
// "BlockNode": null,
Expand Down
4 changes: 2 additions & 2 deletions gno.land/cmd/gnoland/testdata/alloc_slice.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ package alloc
var buffer []int

func DoAlloc() {
buffer := make([]int, 1_000_000_000_000)
buffer[1] = 1
buffer := make([]int, 1_000_000_000_000)
buffer[1] = 1
}
6 changes: 3 additions & 3 deletions gno.land/pkg/sdk/vm/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
baseStore := ms.GetStore(vm.baseKey)
iavlStore := ms.GetStore(vm.iavlKey)

alloc := gno.NewAllocator(maxAllocTx)
alloc := gno.NewAllocator(maxAllocTx, gno.NewHeap())
vm.gnoStore = gno.NewStore(alloc, baseStore, iavlStore)
vm.gnoStore.SetNativeStore(stdlibs.NativeStore)

Expand Down Expand Up @@ -698,7 +698,7 @@
// TODO: modify query protocol to allow MsgEval.
// TODO: then, rename to "Eval".
func (vm *VMKeeper) QueryEval(ctx sdk.Context, pkgPath string, expr string) (res string, err error) {
alloc := gno.NewAllocator(maxAllocQuery)
alloc := gno.NewAllocator(maxAllocQuery, gno.NewHeap())

Check warning on line 701 in gno.land/pkg/sdk/vm/keeper.go

View check run for this annotation

Codecov / codecov/patch

gno.land/pkg/sdk/vm/keeper.go#L701

Added line #L701 was not covered by tests
gnostore := vm.newGnoTransactionStore(ctx) // throwaway (never committed)
pkgAddr := gno.DerivePkgAddr(pkgPath)
// Get Package.
Expand Down Expand Up @@ -765,7 +765,7 @@
// TODO: modify query protocol to allow MsgEval.
// TODO: then, rename to "EvalString".
func (vm *VMKeeper) QueryEvalString(ctx sdk.Context, pkgPath string, expr string) (res string, err error) {
alloc := gno.NewAllocator(maxAllocQuery)
alloc := gno.NewAllocator(maxAllocQuery, gno.NewHeap())

Check warning on line 768 in gno.land/pkg/sdk/vm/keeper.go

View check run for this annotation

Codecov / codecov/patch

gno.land/pkg/sdk/vm/keeper.go#L768

Added line #L768 was not covered by tests
gnostore := vm.newGnoTransactionStore(ctx) // throwaway (never committed)
pkgAddr := gno.DerivePkgAddr(pkgPath)
// Get Package.
Expand Down
4 changes: 2 additions & 2 deletions gnovm/cmd/gno/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ func gnoTestPkg(
if printRuntimeMetrics {
// from tm2/pkg/sdk/vm/keeper.go
// XXX: make maxAllocTx configurable.
maxAllocTx := int64(500 * 1000 * 1000)
maxAllocTx := int64(50 * 1000 * 1000)

m.Alloc = gno.NewAllocator(maxAllocTx)
m.Alloc = gno.NewAllocator(maxAllocTx, gno.NewHeap())
}
m.RunMemPackage(memPkg, true)
err := runTestFiles(m, tfiles, memPkg.Name, verbose, printRuntimeMetrics, runFlag, io)
Expand Down
1 change: 1 addition & 0 deletions gnovm/cmd/gno/testdata/gno_test/realm_correct.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func main() {
// "RefCount": "2"
// },
// "Parent": null,
// "Roots": null,
// "Source": {
// "@type": "/gno.RefNode",
// "BlockNode": null,
Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/testdata/gno_test/realm_incorrect.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ stderr '=== RUN file/x_filetest.gno'
stderr 'panic: fail on x_filetest.gno: diff:'
stderr '--- Expected'
stderr '\+\+\+ Actual'
stderr '@@ -1 \+1,66 @@'
stderr '@@ -1 \+1,67 @@'
stderr '-xxx'
stderr '\+switchrealm\["gno.land/r/x"\]'

Expand Down
Loading
Loading