diff --git a/api/lib_test.go b/api/lib_test.go index e62e8e153..b048ea54f 100644 --- a/api/lib_test.go +++ b/api/lib_test.go @@ -208,7 +208,7 @@ func TestGetMetrics(t *testing.T) { assert.Equal(t, &types.Metrics{ HitsFsCache: 1, ElementsMemoryCache: 1, - SizeMemoryCache: 5576140, + SizeMemoryCache: 5549819, }, metrics) // Instantiate 2 @@ -223,7 +223,7 @@ func TestGetMetrics(t *testing.T) { HitsMemoryCache: 1, HitsFsCache: 1, ElementsMemoryCache: 1, - SizeMemoryCache: 5576140, + SizeMemoryCache: 5549819, }, metrics) // Pin @@ -238,8 +238,8 @@ func TestGetMetrics(t *testing.T) { HitsFsCache: 1, ElementsPinnedMemoryCache: 1, ElementsMemoryCache: 1, - SizePinnedMemoryCache: 5576140, - SizeMemoryCache: 5576140, + SizePinnedMemoryCache: 5549819, + SizeMemoryCache: 5549819, }, metrics) // Instantiate 3 @@ -256,8 +256,8 @@ func TestGetMetrics(t *testing.T) { HitsFsCache: 1, ElementsPinnedMemoryCache: 1, ElementsMemoryCache: 1, - SizePinnedMemoryCache: 5576140, - SizeMemoryCache: 5576140, + SizePinnedMemoryCache: 5549819, + SizeMemoryCache: 5549819, }, metrics) // Unpin @@ -274,7 +274,7 @@ func TestGetMetrics(t *testing.T) { ElementsPinnedMemoryCache: 0, ElementsMemoryCache: 1, SizePinnedMemoryCache: 0, - SizeMemoryCache: 5576140, + SizeMemoryCache: 5549819, }, metrics) // Instantiate 4 @@ -292,7 +292,7 @@ func TestGetMetrics(t *testing.T) { ElementsPinnedMemoryCache: 0, ElementsMemoryCache: 1, SizePinnedMemoryCache: 0, - SizeMemoryCache: 5576140, + SizeMemoryCache: 5549819, }, metrics) } @@ -319,7 +319,7 @@ func TestInstantiate(t *testing.T) { res, cost, err := Instantiate(cache, checksum, env, info, msg, &igasMeter, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG) require.NoError(t, err) requireOkResponse(t, res, 0) - assert.Equal(t, uint64(0x1302be720), cost) + assert.Equal(t, uint64(0x12dbfa210), cost) var result types.ContractResult err = json.Unmarshal(res, &result) @@ -350,7 +350,7 @@ func TestExecute(t *testing.T) { diff := time.Now().Sub(start) require.NoError(t, err) requireOkResponse(t, res, 0) - assert.Equal(t, uint64(0x1302be720), cost) + assert.Equal(t, uint64(0x12dbfa210), cost) t.Logf("Time (%d gas): %s\n", cost, diff) // execute with the same store @@ -363,7 +363,7 @@ func TestExecute(t *testing.T) { res, cost, err = Execute(cache, checksum, env, info, []byte(`{"release":{}}`), &igasMeter2, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG) diff = time.Now().Sub(start) require.NoError(t, err) - assert.Equal(t, uint64(0x22beeb9c0), cost) + assert.Equal(t, uint64(0x21ed35160), cost) t.Logf("Time (%d gas): %s\n", cost, diff) // make sure it read the balance properly and we got 250 atoms @@ -414,7 +414,7 @@ func TestExecuteCpuLoop(t *testing.T) { diff := time.Now().Sub(start) require.NoError(t, err) requireOkResponse(t, res, 0) - assert.Equal(t, uint64(0x1302be720), cost) + assert.Equal(t, uint64(0x12dbfa210), cost) t.Logf("Time (%d gas): %s\n", cost, diff) // execute a cpu loop @@ -565,7 +565,7 @@ func TestMultipleInstances(t *testing.T) { require.NoError(t, err) requireOkResponse(t, res, 0) // we now count wasm gas charges and db writes - assert.Equal(t, uint64(0x12df69090), cost) + assert.Equal(t, uint64(0x12b9c9b00), cost) // instance2 controlled by mary gasMeter2 := NewMockGasMeter(TESTING_GAS_LIMIT) @@ -576,14 +576,14 @@ func TestMultipleInstances(t *testing.T) { res, cost, err = Instantiate(cache, checksum, env, info, msg, &igasMeter2, store2, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG) require.NoError(t, err) requireOkResponse(t, res, 0) - assert.Equal(t, uint64(0x12f3b93b0), cost) + assert.Equal(t, uint64(0x12cd87660), cost) // fail to execute store1 with mary - resp := exec(t, cache, checksum, "mary", store1, api, querier, 0x11aeb5e40) + resp := exec(t, cache, checksum, "mary", store1, api, querier, 0x114691bc0) require.Equal(t, "Unauthorized", resp.Err) // succeed to execute store1 with fred - resp = exec(t, cache, checksum, "fred", store1, api, querier, 0x22ae53900) + resp = exec(t, cache, checksum, "fred", store1, api, querier, 0x21dd2f860) require.Equal(t, "", resp.Err) require.Equal(t, 1, len(resp.Ok.Messages)) attributes := resp.Ok.Attributes @@ -592,7 +592,7 @@ func TestMultipleInstances(t *testing.T) { require.Equal(t, "bob", attributes[1].Value) // succeed to execute store2 with mary - resp = exec(t, cache, checksum, "mary", store2, api, querier, 0x22b69f960) + resp = exec(t, cache, checksum, "mary", store2, api, querier, 0x21e5324e0) require.Equal(t, "", resp.Err) require.Equal(t, 1, len(resp.Ok.Messages)) attributes = resp.Ok.Attributes diff --git a/api/testdata/hackatom.wasm b/api/testdata/hackatom.wasm index c52dd71df..bf0cc63f6 100644 Binary files a/api/testdata/hackatom.wasm and b/api/testdata/hackatom.wasm differ diff --git a/api/testdata/ibc_reflect.wasm b/api/testdata/ibc_reflect.wasm index 6afe2c2ad..066061225 100644 Binary files a/api/testdata/ibc_reflect.wasm and b/api/testdata/ibc_reflect.wasm differ diff --git a/api/testdata/queue.wasm b/api/testdata/queue.wasm index 7649897db..1d013c1a3 100644 Binary files a/api/testdata/queue.wasm and b/api/testdata/queue.wasm differ diff --git a/api/testdata/reflect.wasm b/api/testdata/reflect.wasm index 5b8da45dc..93134ce47 100644 Binary files a/api/testdata/reflect.wasm and b/api/testdata/reflect.wasm differ diff --git a/lib_test.go b/lib_test.go index eedb670e5..92c443ff4 100644 --- a/lib_test.go +++ b/lib_test.go @@ -133,7 +133,7 @@ func TestGetMetrics(t *testing.T) { assert.Equal(t, &types.Metrics{ HitsFsCache: 1, ElementsMemoryCache: 1, - SizeMemoryCache: 5576140, + SizeMemoryCache: 5549819, }, metrics) // Instantiate 2 @@ -149,7 +149,7 @@ func TestGetMetrics(t *testing.T) { HitsMemoryCache: 1, HitsFsCache: 1, ElementsMemoryCache: 1, - SizeMemoryCache: 5576140, + SizeMemoryCache: 5549819, }, metrics) // Pin @@ -164,8 +164,8 @@ func TestGetMetrics(t *testing.T) { HitsFsCache: 1, ElementsPinnedMemoryCache: 1, ElementsMemoryCache: 1, - SizePinnedMemoryCache: 5576140, - SizeMemoryCache: 5576140, + SizePinnedMemoryCache: 5549819, + SizeMemoryCache: 5549819, }, metrics) // Instantiate 3 @@ -183,8 +183,8 @@ func TestGetMetrics(t *testing.T) { HitsFsCache: 1, ElementsPinnedMemoryCache: 1, ElementsMemoryCache: 1, - SizePinnedMemoryCache: 5576140, - SizeMemoryCache: 5576140, + SizePinnedMemoryCache: 5549819, + SizeMemoryCache: 5549819, }, metrics) // Unpin @@ -201,7 +201,7 @@ func TestGetMetrics(t *testing.T) { ElementsPinnedMemoryCache: 0, ElementsMemoryCache: 1, SizePinnedMemoryCache: 0, - SizeMemoryCache: 5576140, + SizeMemoryCache: 5549819, }, metrics) // Instantiate 4 @@ -220,6 +220,6 @@ func TestGetMetrics(t *testing.T) { ElementsPinnedMemoryCache: 0, ElementsMemoryCache: 1, SizePinnedMemoryCache: 0, - SizeMemoryCache: 5576140, + SizeMemoryCache: 5549819, }, metrics) } diff --git a/libwasmvm/Cargo.lock b/libwasmvm/Cargo.lock index f8be45e7b..5c384b460 100644 --- a/libwasmvm/Cargo.lock +++ b/libwasmvm/Cargo.lock @@ -183,8 +183,8 @@ checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" [[package]] name = "cosmwasm-crypto" -version = "1.0.0-beta4" -source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.0.0-beta4#ff729d885df9de9965e4027175d1f887fa97b1a0" +version = "1.0.0-beta5" +source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.0.0-beta5#be4d94a8d73ceab359226b8ea0a5b4be032a07e6" dependencies = [ "digest", "ed25519-zebra", @@ -195,16 +195,16 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "1.0.0-beta4" -source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.0.0-beta4#ff729d885df9de9965e4027175d1f887fa97b1a0" +version = "1.0.0-beta5" +source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.0.0-beta5#be4d94a8d73ceab359226b8ea0a5b4be032a07e6" dependencies = [ "syn", ] [[package]] name = "cosmwasm-std" -version = "1.0.0-beta4" -source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.0.0-beta4#ff729d885df9de9965e4027175d1f887fa97b1a0" +version = "1.0.0-beta5" +source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.0.0-beta5#be4d94a8d73ceab359226b8ea0a5b4be032a07e6" dependencies = [ "base64", "cosmwasm-crypto", @@ -218,8 +218,8 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "1.0.0-beta4" -source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.0.0-beta4#ff729d885df9de9965e4027175d1f887fa97b1a0" +version = "1.0.0-beta5" +source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.0.0-beta5#be4d94a8d73ceab359226b8ea0a5b4be032a07e6" dependencies = [ "clru", "cosmwasm-crypto", diff --git a/libwasmvm/Cargo.toml b/libwasmvm/Cargo.toml index 0b4be5a2d..05e7f5727 100644 --- a/libwasmvm/Cargo.toml +++ b/libwasmvm/Cargo.toml @@ -26,8 +26,8 @@ default = [] backtraces = [] [dependencies] -cosmwasm-std = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "v1.0.0-beta4", features = ["staking", "stargate", "iterator"] } -cosmwasm-vm = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "v1.0.0-beta4", features = ["staking", "stargate", "iterator"] } +cosmwasm-std = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "v1.0.0-beta5", features = ["staking", "stargate", "iterator"] } +cosmwasm-vm = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "v1.0.0-beta5", features = ["staking", "stargate", "iterator"] } errno = "0.2" serde_json = "1.0" thiserror = "1.0" diff --git a/libwasmvm/src/cache.rs b/libwasmvm/src/cache.rs index 9f3f32a26..e053ec21d 100644 --- a/libwasmvm/src/cache.rs +++ b/libwasmvm/src/cache.rs @@ -702,7 +702,7 @@ mod tests { misses: 0, elements_pinned_memory_cache: 1, elements_memory_cache: 0, - size_pinned_memory_cache: 5576140, + size_pinned_memory_cache: 5549819, size_memory_cache: 0, } );