Skip to content

Commit

Permalink
Merge pull request #1914 from CortexFoundation/dev
Browse files Browse the repository at this point in the history
max uint64 used
  • Loading branch information
ucwong authored Feb 19, 2024
2 parents aa5f366 + 902bbae commit 0aa9ac5
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 9 deletions.
5 changes: 3 additions & 2 deletions core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package vm

import (
"errors"
"math"

"github.com/CortexFoundation/CortexTheseus/common"
"github.com/CortexFoundation/CortexTheseus/core/types"
Expand Down Expand Up @@ -377,7 +378,7 @@ func opCodeCopy(pc *uint64, interpreter *CVMInterpreter, callContext *ScopeConte
)
uint64CodeOffset, overflow := codeOffset.Uint64WithOverflow()
if overflow {
uint64CodeOffset = 0xffffffffffffffff
uint64CodeOffset = math.MaxUint64
}
codeCopy := getData(callContext.Contract.Code, uint64CodeOffset, length.Uint64())
callContext.Memory.Set(memOffset.Uint64(), length.Uint64(), codeCopy)
Expand All @@ -394,7 +395,7 @@ func opExtCodeCopy(pc *uint64, interpreter *CVMInterpreter, callContext *ScopeCo
)
uint64CodeOffset, overflow := codeOffset.Uint64WithOverflow()
if overflow {
uint64CodeOffset = 0xffffffffffffffff
uint64CodeOffset = math.MaxUint64
}
addr := common.Address(a.Bytes20())
codeCopy := getData(interpreter.cvm.StateDB.GetCode(addr), uint64CodeOffset, length.Uint64())
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.0
github.com/CortexFoundation/inference v1.0.2-0.20230307032835-9197d586a4e8
github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66
github.com/CortexFoundation/torrentfs v1.0.61-0.20240217172511-425726c804ae
github.com/CortexFoundation/torrentfs v1.0.61-0.20240218153713-f94ec6e020af
github.com/VictoriaMetrics/fastcache v1.12.2
github.com/arsham/figurine v1.3.0
github.com/aws/aws-sdk-go-v2 v1.25.0
Expand Down Expand Up @@ -78,6 +78,7 @@ require (
require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect
github.com/CortexFoundation/compress v0.0.0-20240218153512-9074bdc2397c // indirect
github.com/CortexFoundation/cvm-runtime v0.0.0-20221117094012-b5a251885572 // indirect
github.com/CortexFoundation/merkletree v0.0.0-20230724124840-b6e80265a137 // indirect
github.com/CortexFoundation/robot v1.0.7-0.20240101144533-02756bceae73 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ github.com/CortexFoundation/CortexTheseus v1.9.56/go.mod h1:MkF8L4FF1jb8K8V6gDDQ
github.com/CortexFoundation/CortexTheseus v1.10.3-0.20200624034846-46f8f368cbee/go.mod h1:S/ekN5n18+CtbVTy4l8G5kmDn3xTFKVrcMUBymY7JwQ=
github.com/CortexFoundation/CortexTheseus v1.10.3-0.20200704025058-f0885ec2bd83/go.mod h1:++9X1TLZ+XbAFxrQO5Cl9T/5/OW6JaLlvVnDsEH0qkA=
github.com/CortexFoundation/CortexTheseus v1.10.8/go.mod h1:BxMcNBe5UuA9WWMLBdHP5JqpFKyCBZza+6FLSMx7Nhk=
github.com/CortexFoundation/compress v0.0.0-20240218153512-9074bdc2397c h1:NPMTQiCmHtWC/68LASsYRtzcvxIwJ8ZI3LANYZ/rXpc=
github.com/CortexFoundation/compress v0.0.0-20240218153512-9074bdc2397c/go.mod h1:ytKxJqa16SAYZcc4PMcdZpfrcYVmhrEKNaaqz7zta0I=
github.com/CortexFoundation/cvm-runtime v0.0.0-20221117094012-b5a251885572 h1:flP0APyj5dlVhNsPIz7+SiB4/N2564+GBy7avBV71gY=
github.com/CortexFoundation/cvm-runtime v0.0.0-20221117094012-b5a251885572/go.mod h1:oLEQaJbHT0SAIVjY90BYPYVikGylXHrPyf1yTPS7HZg=
github.com/CortexFoundation/inference v1.0.2-0.20230307032835-9197d586a4e8 h1:W/iuMZd13mB6OSIEd9ahMHFAeQ8zLv+peIFYcMirvag=
Expand All @@ -68,8 +70,8 @@ github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66/go.mod h1:
github.com/CortexFoundation/torrentfs v1.0.13-0.20200623060705-ce027f43f2f8/go.mod h1:Ma+tGhPPvz4CEZHaqEJQMOEGOfHeQBiAoNd1zyc/w3Q=
github.com/CortexFoundation/torrentfs v1.0.14-0.20200703071639-3fcabcabf274/go.mod h1:qnb3YlIJmuetVBtC6Lsejr0Xru+1DNmDCdTqnwy7lhk=
github.com/CortexFoundation/torrentfs v1.0.20-0.20200810031954-d36d26f82fcc/go.mod h1:N5BsicP5ynjXIi/Npl/SRzlJ630n1PJV2sRj0Z0t2HA=
github.com/CortexFoundation/torrentfs v1.0.61-0.20240217172511-425726c804ae h1:Vma5qyhPoxxoZbHLfPyegjx+0uaV26D/C4W6p3dZibE=
github.com/CortexFoundation/torrentfs v1.0.61-0.20240217172511-425726c804ae/go.mod h1:wP+9i7N+I5uh6vc/HJsfM1EuGTBZyM0GLpwAXXt/t0U=
github.com/CortexFoundation/torrentfs v1.0.61-0.20240218153713-f94ec6e020af h1:ew/+Cf+gDVOspYAOY6YCObueve4L6qkbeaAsMNdlsFo=
github.com/CortexFoundation/torrentfs v1.0.61-0.20240218153713-f94ec6e020af/go.mod h1:/l6mtw/YwSfWqSmRgE9Pdb/pOxpKNktBdnFt+qWrwx4=
github.com/CortexFoundation/wormhole v0.0.2-0.20231221155549-5c938553b5fc h1:LkbBJvvbfraAg/joFxPZtDvmdrjuTqPfbGhdnrEq7GM=
github.com/CortexFoundation/wormhole v0.0.2-0.20231221155549-5c938553b5fc/go.mod h1:ipzmPabDgzYKUbXkGVe2gTkBEp+MsDx6pXGiuYzmP6s=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
Expand Down
21 changes: 21 additions & 0 deletions vendor/github.com/CortexFoundation/compress/.gitignore

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

21 changes: 21 additions & 0 deletions vendor/github.com/CortexFoundation/compress/LICENSE

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

1 change: 1 addition & 0 deletions vendor/github.com/CortexFoundation/compress/README.md

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

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

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

6 changes: 4 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/shared
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/pageblob
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/service
# github.com/CortexFoundation/compress v0.0.0-20240218153512-9074bdc2397c
## explicit; go 1.21
github.com/CortexFoundation/compress
# github.com/CortexFoundation/cvm-runtime v0.0.0-20221117094012-b5a251885572
## explicit; go 1.14
github.com/CortexFoundation/cvm-runtime/kernel
Expand All @@ -58,13 +61,12 @@ github.com/CortexFoundation/robot/backend
# github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66
## explicit; go 1.16
github.com/CortexFoundation/statik
# github.com/CortexFoundation/torrentfs v1.0.61-0.20240217172511-425726c804ae
# github.com/CortexFoundation/torrentfs v1.0.61-0.20240218153713-f94ec6e020af
## explicit; go 1.21
github.com/CortexFoundation/torrentfs
github.com/CortexFoundation/torrentfs/backend
github.com/CortexFoundation/torrentfs/backend/caffe
github.com/CortexFoundation/torrentfs/backend/job
github.com/CortexFoundation/torrentfs/compress
github.com/CortexFoundation/torrentfs/params
github.com/CortexFoundation/torrentfs/tool
github.com/CortexFoundation/torrentfs/types
Expand Down

0 comments on commit 0aa9ac5

Please sign in to comment.