Skip to content

Commit 3565576

Browse files
authored
Lower DefaultMaxCallDepth (#2244)
* Lower DefaultMaxCallDepth * Add changelog entry * Fix test
1 parent a325741 commit 3565576

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.55.0...HEAD)
66

7+
- Lower `DefaultMaxCallDepth` [\#2244](https://github.com/CosmWasm/wasmd/pull/2244)
8+
79
## [v0.55.0](https://github.com/CosmWasm/wasmd/tree/v0.55.0) (2025-03-11)
810

911
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.54.0...v0.55.0)

tests/system/cli.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ var (
461461
const oogMsg = "out of gas"
462462
return expErrWithMsg(t, err, args, oogMsg)
463463
}
464+
// ErrMaxCallDepthMatcher requires error with "max call depth exceeded" message
465+
ErrMaxCallDepthMatcher RunErrorAssert = func(t assert.TestingT, err error, args ...interface{}) bool {
466+
const expMsg = "max call depth exceeded"
467+
return expErrWithMsg(t, err, args, expMsg)
468+
}
464469
// ErrTimeoutMatcher requires time out message
465470
ErrTimeoutMatcher RunErrorAssert = func(t assert.TestingT, err error, args ...interface{}) bool {
466471
const expMsg = "timed out waiting for tx to be included in a block"

tests/system/fraud_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestRecursiveMsgsExternalTrigger(t *testing.T) {
2929
}{
3030
"simulation": {
3131
gas: "auto",
32-
expErrMatcher: ErrOutOfGasMatcher,
32+
expErrMatcher: ErrMaxCallDepthMatcher,
3333
},
3434
}
3535
for name, spec := range specs {

x/wasm/types/wasm_engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
// DefaultMaxQueryStackSize maximum size of the stack of recursive queries a contract can make
1111
const DefaultMaxQueryStackSize uint32 = 10
1212

13-
const DefaultMaxCallDepth uint32 = 500
13+
const DefaultMaxCallDepth uint32 = 100
1414

1515
// WasmEngine defines the WASM contract runtime engine.
1616
type WasmEngine interface {

0 commit comments

Comments
 (0)