diff --git a/contracts/package.json b/contracts/package.json index 9c8c4ea73b..5ba922d48b 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -26,5 +26,8 @@ "ethers": "^6.6.0", "hardhat-ignore-warnings": "^0.2.6", "ten-hardhat-plugin": "^0.0.9" + }, + "peerDependencies": { + "@nomicfoundation/hardhat-verify" : "2.0.8" } } diff --git a/go/enclave/main/main.go b/go/enclave/main/main.go index 48ffc8c4be..fa798e2241 100644 --- a/go/enclave/main/main.go +++ b/go/enclave/main/main.go @@ -2,11 +2,13 @@ package main import ( "fmt" - "github.com/ten-protocol/go-ten/go/common/container" tenflag "github.com/ten-protocol/go-ten/go/common/flag" "github.com/ten-protocol/go-ten/go/config" enclavecontainer "github.com/ten-protocol/go-ten/go/enclave/container" + "os" + "runtime/pprof" + "time" ) // Runs an Obscuro enclave as a standalone process. @@ -25,6 +27,29 @@ func main() { panic(fmt.Errorf("unable to create config from flags - %w", err)) } + // temporary code to help identify OOM + go func() { + for { + heap, err := os.Create(fmt.Sprintf("/data/heap_%d.pprof", time.Now().UnixMilli())) + if err != nil { + panic(fmt.Errorf("could not open heap profile: %w", err)) + } + err = pprof.WriteHeapProfile(heap) + if err != nil { + panic(fmt.Errorf("could not write CPU profile: %w", err)) + } + stack, err := os.Create(fmt.Sprintf("/data/stack_%d.pprof", time.Now().UnixMilli())) + if err != nil { + panic(fmt.Errorf("could not open stack profile: %w", err)) + } + err = pprof.Lookup("goroutine").WriteTo(stack, 1) + if err != nil { + panic(fmt.Errorf("could not write CPU profile: %w", err)) + } + time.Sleep(1 * time.Hour) + } + }() + enclaveContainer := enclavecontainer.NewEnclaveContainerFromConfig(enclaveConfig) container.Serve(enclaveContainer) }