Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def main():
if status.status != "pending":
sys.exit(f"incorrect status of transaction: expected->pending, received->{status}")

provider.do_post_generic(f"{GENERATE_BLOCKS_URL}/3", {})
status = status = provider.get_transaction_status(tx_hash)
provider.do_post_generic(f"{GENERATE_BLOCKS_URL}/6", {})
status = provider.get_transaction_status(tx_hash)
if status.status != "fail":
sys.exit(f"incorrect status of transaction: expected->fail, received->{status}")

Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
module github.com/multiversx/mx-chain-simulator-go

go 1.23
go 1.23.0

require (
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792
github.com/gin-gonic/gin v1.10.0
github.com/multiversx/mx-chain-core-go v1.4.2-0.20251022090220-a99e14e45706
github.com/multiversx/mx-chain-go v1.10.9-0.20251202080801-f93cacaf0a4d
github.com/multiversx/mx-chain-core-go v1.4.2-0.20251216155248-bcbea61e6f31
github.com/multiversx/mx-chain-go v1.10.9-0.20251219154857-aebf301be8fb
github.com/multiversx/mx-chain-logger-go v1.1.0
github.com/multiversx/mx-chain-proxy-go v1.3.1
github.com/multiversx/mx-chain-proxy-go v1.3.5-0.20251222095819-21763951cae2
github.com/multiversx/mx-chain-storage-go v1.1.0
github.com/pelletier/go-toml v1.9.3
github.com/stretchr/testify v1.10.0
github.com/urfave/cli v1.22.16
Expand Down Expand Up @@ -120,9 +121,8 @@ require (
github.com/multiversx/concurrent-map v0.1.4 // indirect
github.com/multiversx/mx-chain-communication-go v1.3.0 // indirect
github.com/multiversx/mx-chain-crypto-go v1.3.0 // indirect
github.com/multiversx/mx-chain-es-indexer-go v1.9.3-0.20251021150757-bd6aa66a0a90 // indirect
github.com/multiversx/mx-chain-es-indexer-go v1.9.3-0.20251209110302-3b451942b7f9 // indirect
github.com/multiversx/mx-chain-scenario-go v1.6.0 // indirect
github.com/multiversx/mx-chain-storage-go v1.1.0 // indirect
github.com/multiversx/mx-chain-vm-common-go v1.6.0 // indirect
github.com/multiversx/mx-chain-vm-go v1.6.1-0.20250707105646-d7048a2657c2 // indirect
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.69 // indirect
Expand Down Expand Up @@ -189,13 +189,13 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/crypto v0.35.0 // indirect
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/tools v0.29.0 // indirect
gonum.org/v1/gonum v0.15.1 // indirect
google.golang.org/protobuf v1.36.4 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -410,18 +410,18 @@ github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUY
github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o=
github.com/multiversx/mx-chain-communication-go v1.3.0 h1:ziNM1dRuiR/7al2L/jGEA/a/hjurtJ/HEqgazHNt9P8=
github.com/multiversx/mx-chain-communication-go v1.3.0/go.mod h1:gDVWn6zUW6aCN1YOm/FbbT5MUmhgn/L1Rmpl8EoH3Yg=
github.com/multiversx/mx-chain-core-go v1.4.2-0.20251022090220-a99e14e45706 h1:rs0XNP+cxwRWL5EnbfMecRHbXd5NzukImJnk58UNsiA=
github.com/multiversx/mx-chain-core-go v1.4.2-0.20251022090220-a99e14e45706/go.mod h1:IO+vspNan+gT0WOHnJ95uvWygiziHZvfXpff6KnxV7g=
github.com/multiversx/mx-chain-core-go v1.4.2-0.20251216155248-bcbea61e6f31 h1:MiqdkQIW3S1z1woQ58UGtPHQUkO8DGMMfEaX+s3oRDA=
github.com/multiversx/mx-chain-core-go v1.4.2-0.20251216155248-bcbea61e6f31/go.mod h1:IO+vspNan+gT0WOHnJ95uvWygiziHZvfXpff6KnxV7g=
github.com/multiversx/mx-chain-crypto-go v1.3.0 h1:0eK2bkDOMi8VbSPrB1/vGJSYT81IBtfL4zw+C4sWe/k=
github.com/multiversx/mx-chain-crypto-go v1.3.0/go.mod h1:nPIkxxzyTP8IquWKds+22Q2OJ9W7LtusC7cAosz7ojM=
github.com/multiversx/mx-chain-es-indexer-go v1.9.3-0.20251021150757-bd6aa66a0a90 h1:Hf6AqpCSHccBo5ZV5Bfaxz3UdPYhtYCynU+3CF4jAa8=
github.com/multiversx/mx-chain-es-indexer-go v1.9.3-0.20251021150757-bd6aa66a0a90/go.mod h1:t1rkD2vHXSI4EClig0h7+kRCSUCRrMF+emr4DHxFtfA=
github.com/multiversx/mx-chain-go v1.10.9-0.20251202080801-f93cacaf0a4d h1:ZmZU29TjlggFo0rptuW4m82Ys37LIB1CFbyDiE2BQic=
github.com/multiversx/mx-chain-go v1.10.9-0.20251202080801-f93cacaf0a4d/go.mod h1:G2LX81y+A75W5EqJod9p4fRAdnp22vpQrB+374pAveQ=
github.com/multiversx/mx-chain-es-indexer-go v1.9.3-0.20251209110302-3b451942b7f9 h1:lywsKESTxcEC+RnmXzF/6T444DVyhl/ft52Rh4JMPyQ=
github.com/multiversx/mx-chain-es-indexer-go v1.9.3-0.20251209110302-3b451942b7f9/go.mod h1:F/BpaYVPuHN7POJN6gwvJfZ22diYtvz2576a+PWiPvw=
github.com/multiversx/mx-chain-go v1.10.9-0.20251219154857-aebf301be8fb h1:BnDm6DhGHLp8e31wZGbyYcCvgM3jrclcRm4wLpfN63M=
github.com/multiversx/mx-chain-go v1.10.9-0.20251219154857-aebf301be8fb/go.mod h1:c/On/Uw6kMUd6009gvmUsL1gZ+ewl9g4sOvmQGP08a0=
github.com/multiversx/mx-chain-logger-go v1.1.0 h1:97x84A6L4RfCa6YOx1HpAFxZp1cf/WI0Qh112whgZNM=
github.com/multiversx/mx-chain-logger-go v1.1.0/go.mod h1:K9XgiohLwOsNACETMNL0LItJMREuEvTH6NsoXWXWg7g=
github.com/multiversx/mx-chain-proxy-go v1.3.1 h1:tjbTm3FpR0bjDvWAMK0zwRxRbbjGszSWltng7jv6CIg=
github.com/multiversx/mx-chain-proxy-go v1.3.1/go.mod h1:cHuW0HW8ygFhnXENyBYHiVSWmK17uheAUjglNNgTTpc=
github.com/multiversx/mx-chain-proxy-go v1.3.5-0.20251222095819-21763951cae2 h1:ZX5197Lg7GeJ0iUP+1Nkgveor9XWG92XfWWN/ePZp6A=
github.com/multiversx/mx-chain-proxy-go v1.3.5-0.20251222095819-21763951cae2/go.mod h1:XrDhWmTjJ3J7DGoaE06jdD+ZkMH7j68qk5pUJ6ZIYKI=
github.com/multiversx/mx-chain-scenario-go v1.6.0 h1:cwDFuS1pSc4YXnfiKKDTEb+QDY4fulPQaiRgIebnKxI=
github.com/multiversx/mx-chain-scenario-go v1.6.0/go.mod h1:GrSYu1SnMvsIm9djUz1X13224HcvdY6Nb5KHNT3xZPA=
github.com/multiversx/mx-chain-storage-go v1.1.0 h1:M1Y9DqMrJ62s7Zw31+cyuqsnPIvlG4jLBJl5WzeZLe8=
Expand Down Expand Up @@ -709,8 +709,8 @@ golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc=
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=
Expand Down Expand Up @@ -776,8 +776,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -840,8 +840,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
Expand Down
10 changes: 6 additions & 4 deletions pkg/facade/simulatorFacade.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import (
)

const (
errMsgTargetEpochLowerThanCurrentEpoch = "target epoch must be greater than current epoch"
errMsgAccountNotFound = "account was not found")
errMsgTargetEpochLowerThanCurrentEpoch = "target epoch must be greater than current epoch"
errMsgAccountNotFound = "account was not found"
numBlocksToGenerate = 2
)

var log = logger.GetOrCreate("simulator/facade")

Expand Down Expand Up @@ -73,7 +75,7 @@ func (sf *simulatorFacade) SetStateMultiple(stateSlice []*dtos.AddressState, noG
return nil
}

return sf.simulator.GenerateBlocks(1)
return sf.simulator.GenerateBlocks(numBlocksToGenerate)
}

// SetStateMultipleOverwrite will set the entire state for the provided address and cleanup the old state of the provided addresses
Expand All @@ -96,7 +98,7 @@ func (sf *simulatorFacade) SetStateMultipleOverwrite(stateSlice []*dtos.AddressS
return nil
}

return sf.simulator.GenerateBlocks(1)
return sf.simulator.GenerateBlocks(numBlocksToGenerate)
}

// AddValidatorKeys will add the validator keys in the multi key handler
Expand Down
11 changes: 10 additions & 1 deletion pkg/proxy/creator/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
processFactory "github.com/multiversx/mx-chain-proxy-go/process/factory"
versionsFactory "github.com/multiversx/mx-chain-proxy-go/versions/factory"
proxy2 "github.com/multiversx/mx-chain-simulator-go/pkg/proxy"
"github.com/multiversx/mx-chain-storage-go/timecache"
)

var log = logger.GetOrCreate("proxy")
Expand Down Expand Up @@ -138,7 +139,15 @@ func CreateProxy(args ArgsProxy) (*ArgsOutputProxy, error) {
valStatsProc.StartCacheUpdate()
nodeStatusProc.StartCacheUpdate()

blockProc, err := processProxy.NewBlockProcessor(bp)
blockCacher, err := timecache.NewTimeCacher(timecache.ArgTimeCacher{
DefaultSpan: time.Second,
CacheExpiry: time.Duration(args.Config.GeneralSettings.BlockCacheDurationSec) * time.Second,
})
if err != nil {
return nil, err
}

blockProc, err := processProxy.NewBlockProcessor(bp, blockCacher)
if err != nil {
return nil, err
}
Expand Down
Loading