diff --git a/api/lib_test.go b/api/lib_test.go index e8e0b9bfc..2c9b112a9 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: 3432787, + SizeMemoryCache: 2953616, }, metrics) // Instantiate 2 @@ -223,7 +223,7 @@ func TestGetMetrics(t *testing.T) { HitsMemoryCache: 1, HitsFsCache: 1, ElementsMemoryCache: 1, - SizeMemoryCache: 3432787, + SizeMemoryCache: 2953616, }, metrics) // Pin @@ -238,8 +238,8 @@ func TestGetMetrics(t *testing.T) { HitsFsCache: 1, ElementsPinnedMemoryCache: 1, ElementsMemoryCache: 1, - SizePinnedMemoryCache: 3432787, - SizeMemoryCache: 3432787, + SizePinnedMemoryCache: 2953616, + SizeMemoryCache: 2953616, }, metrics) // Instantiate 3 @@ -256,8 +256,8 @@ func TestGetMetrics(t *testing.T) { HitsFsCache: 1, ElementsPinnedMemoryCache: 1, ElementsMemoryCache: 1, - SizePinnedMemoryCache: 3432787, - SizeMemoryCache: 3432787, + SizePinnedMemoryCache: 2953616, + SizeMemoryCache: 2953616, }, metrics) // Unpin @@ -274,7 +274,7 @@ func TestGetMetrics(t *testing.T) { ElementsPinnedMemoryCache: 0, ElementsMemoryCache: 1, SizePinnedMemoryCache: 0, - SizeMemoryCache: 3432787, + SizeMemoryCache: 2953616, }, metrics) // Instantiate 4 @@ -292,7 +292,7 @@ func TestGetMetrics(t *testing.T) { ElementsPinnedMemoryCache: 0, ElementsMemoryCache: 1, SizePinnedMemoryCache: 0, - SizeMemoryCache: 3432787, + SizeMemoryCache: 2953616, }, 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(0x8e99), cost) + assert.Equal(t, uint64(0x85b0), 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(0x8e99), cost) + assert.Equal(t, uint64(0x85b0), 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(0xef2c), cost) + assert.Equal(t, uint64(0xf043), cost) t.Logf("Time (%d gas): %s\n", cost, diff) // make sure it read the balance properly and we got 250 atoms @@ -372,7 +372,16 @@ func TestExecute(t *testing.T) { require.NoError(t, err) require.Equal(t, "", result.Err) require.Equal(t, 1, len(result.Ok.Messages)) - dispatch := result.Ok.Messages[0] + + // Ensure we got our custom event + assert.Equal(t, len(result.Ok.Events), 1) + ev := result.Ok.Events[0] + assert.Equal(t, ev.Type, "hackatom") + assert.Equal(t, len(ev.Attributes), 1) + assert.Equal(t, ev.Attributes[0].Key, "action") + assert.Equal(t, ev.Attributes[0].Value, "release") + + dispatch := result.Ok.Messages[0].Msg require.NotNil(t, dispatch.Bank, "%#v", dispatch) require.NotNil(t, dispatch.Bank.Send, "%#v", dispatch) send := dispatch.Bank.Send @@ -405,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(0x8e99), cost) + assert.Equal(t, uint64(0x85b0), cost) t.Logf("Time (%d gas): %s\n", cost, diff) // execute a cpu loop @@ -556,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(0x8d78), cost) + assert.Equal(t, uint64(0x84ad), cost) // instance2 controlled by mary gasMeter2 := NewMockGasMeter(TESTING_GAS_LIMIT) @@ -567,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(0x8e1d), cost) + assert.Equal(t, uint64(0x8541), cost) // fail to execute store1 with mary - resp := exec(t, cache, checksum, "mary", store1, api, querier, 0x79ee) + resp := exec(t, cache, checksum, "mary", store1, api, querier, 0x75ab) require.Equal(t, "Unauthorized", resp.Err) // succeed to execute store1 with fred - resp = exec(t, cache, checksum, "fred", store1, api, querier, 0xeeb8) + resp = exec(t, cache, checksum, "fred", store1, api, querier, 0xefcf) require.Equal(t, "", resp.Err) require.Equal(t, 1, len(resp.Ok.Messages)) attributes := resp.Ok.Attributes @@ -583,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, 0xeef2) + resp = exec(t, cache, checksum, "mary", store2, api, querier, 0xf009) require.Equal(t, "", resp.Err) require.Equal(t, 1, len(resp.Ok.Messages)) attributes = resp.Ok.Attributes @@ -627,7 +636,7 @@ func TestSudo(t *testing.T) { require.NoError(t, err) require.Equal(t, "", result.Err) require.Equal(t, 1, len(result.Ok.Messages)) - dispatch := result.Ok.Messages[0] + dispatch := result.Ok.Messages[0].Msg require.NotNil(t, dispatch.Bank, "%#v", dispatch) require.NotNil(t, dispatch.Bank.Send, "%#v", dispatch) send := dispatch.Bank.Send @@ -667,7 +676,7 @@ func TestDispatchSubmessage(t *testing.T) { } payloadBin, err := json.Marshal(payload) require.NoError(t, err) - payloadMsg := []byte(fmt.Sprintf(`{"reflect_sub_call":{"msgs":[%s]}}`, string(payloadBin))) + payloadMsg := []byte(fmt.Sprintf(`{"reflect_sub_msg":{"msgs":[%s]}}`, string(payloadBin))) gasMeter2 := NewMockGasMeter(TESTING_GAS_LIMIT) igasMeter2 := GasMeter(gasMeter2) @@ -681,9 +690,8 @@ func TestDispatchSubmessage(t *testing.T) { err = json.Unmarshal(res, &result) require.NoError(t, err) require.Equal(t, "", result.Err) - require.Equal(t, 0, len(result.Ok.Messages)) - require.Equal(t, 1, len(result.Ok.Submessages)) - dispatch := result.Ok.Submessages[0] + require.Equal(t, 1, len(result.Ok.Messages)) + dispatch := result.Ok.Messages[0] assert.Equal(t, id, dispatch.ID) assert.Equal(t, payload.Msg, dispatch.Msg) assert.Nil(t, dispatch.GasLimit) @@ -739,12 +747,12 @@ func TestReplyAndQuery(t *testing.T) { requireOkResponse(t, res, 0) // now query the state to see if it stored the data properly - badQuery := []byte(`{"sub_call_result":{"id":7777}}`) + badQuery := []byte(`{"sub_msg_result":{"id":7777}}`) res, _, err = Query(cache, checksum, env, badQuery, &igasMeter2, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG) require.NoError(t, err) requireQueryError(t, res) - query := []byte(`{"sub_call_result":{"id":1234}}`) + query := []byte(`{"sub_msg_result":{"id":1234}}`) res, _, err = Query(cache, checksum, env, query, &igasMeter2, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG) require.NoError(t, err) qres := requireQueryOk(t, res) diff --git a/api/testdata/hackatom.wasm b/api/testdata/hackatom.wasm index e9f0b9050..92f5db409 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 33f49b33e..b0397a44e 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 224ec4b4c..15690b1ce 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 4606c4a8d..75dcc6fb7 100644 Binary files a/api/testdata/reflect.wasm and b/api/testdata/reflect.wasm differ diff --git a/ibc_test.go b/ibc_test.go index abe63fc11..0ed94b051 100644 --- a/ibc_test.go +++ b/ibc_test.go @@ -126,16 +126,15 @@ func TestIBCHandshake(t *testing.T) { channel = api.MockIBCChannel(CHANNEL_ID, types.Ordered, IBC_VERSION) res, _, err := vm.IBCChannelConnect(checksum, env, channel, store, *goapi, querier, gasMeter2, TESTING_GAS_LIMIT) require.NoError(t, err) - require.Equal(t, 0, len(res.Messages)) - require.Equal(t, 1, len(res.Submessages)) + require.Equal(t, 1, len(res.Messages)) // make sure it read the balance properly and we got 250 atoms - dispatch := res.Submessages[0].Msg + dispatch := res.Messages[0].Msg require.NotNil(t, dispatch.Wasm, "%#v", dispatch) require.NotNil(t, dispatch.Wasm.Instantiate, "%#v", dispatch) init := dispatch.Wasm.Instantiate assert.Equal(t, REFLECT_ID, init.CodeID) - assert.Empty(t, init.Send) + assert.Empty(t, init.Funds) } func TestIBCPacketDispatch(t *testing.T) { @@ -180,9 +179,8 @@ func TestIBCPacketDispatch(t *testing.T) { channel = api.MockIBCChannel(CHANNEL_ID, types.Ordered, IBC_VERSION) res, _, err := vm.IBCChannelConnect(checksum, env, channel, store, *goapi, querier, gasMeter3, TESTING_GAS_LIMIT) require.NoError(t, err) - require.Equal(t, 0, len(res.Messages)) - require.Equal(t, 1, len(res.Submessages)) - id := res.Submessages[0].ID + require.Equal(t, 1, len(res.Messages)) + id := res.Messages[0].ID // mock reflect init callback (to store address) gasMeter4 := api.NewMockGasMeter(TESTING_GAS_LIMIT) diff --git a/lib.go b/lib.go index 3c0c9a0e5..27b70c8df 100644 --- a/lib.go +++ b/lib.go @@ -483,7 +483,7 @@ func (vm *VM) IBCPacketReceive( func (vm *VM) IBCPacketAck( checksum Checksum, env types.Env, - ack types.IBCAcknowledgement, + ack types.IBCAcknowledgementWithPacket, store KVStore, goapi GoAPI, querier Querier, diff --git a/lib_test.go b/lib_test.go index b95039ddd..164ea527c 100644 --- a/lib_test.go +++ b/lib_test.go @@ -82,7 +82,7 @@ func TestHappyPath(t *testing.T) { require.Equal(t, 1, len(hres.Messages)) // make sure it read the balance properly and we got 250 atoms - dispatch := hres.Messages[0] + dispatch := hres.Messages[0].Msg require.NotNil(t, dispatch.Bank, "%#v", dispatch) require.NotNil(t, dispatch.Bank.Send, "%#v", dispatch) send := dispatch.Bank.Send @@ -130,7 +130,7 @@ func TestGetMetrics(t *testing.T) { assert.Equal(t, &types.Metrics{ HitsFsCache: 1, ElementsMemoryCache: 1, - SizeMemoryCache: 3432787, + SizeMemoryCache: 2953616, }, metrics) // Instantiate 2 @@ -146,7 +146,7 @@ func TestGetMetrics(t *testing.T) { HitsMemoryCache: 1, HitsFsCache: 1, ElementsMemoryCache: 1, - SizeMemoryCache: 3432787, + SizeMemoryCache: 2953616, }, metrics) // Pin @@ -161,8 +161,8 @@ func TestGetMetrics(t *testing.T) { HitsFsCache: 1, ElementsPinnedMemoryCache: 1, ElementsMemoryCache: 1, - SizePinnedMemoryCache: 3432787, - SizeMemoryCache: 3432787, + SizePinnedMemoryCache: 2953616, + SizeMemoryCache: 2953616, }, metrics) // Instantiate 3 @@ -180,8 +180,8 @@ func TestGetMetrics(t *testing.T) { HitsFsCache: 1, ElementsPinnedMemoryCache: 1, ElementsMemoryCache: 1, - SizePinnedMemoryCache: 3432787, - SizeMemoryCache: 3432787, + SizePinnedMemoryCache: 2953616, + SizeMemoryCache: 2953616, }, metrics) // Unpin @@ -198,7 +198,7 @@ func TestGetMetrics(t *testing.T) { ElementsPinnedMemoryCache: 0, ElementsMemoryCache: 1, SizePinnedMemoryCache: 0, - SizeMemoryCache: 3432787, + SizeMemoryCache: 2953616, }, metrics) // Instantiate 4 @@ -217,6 +217,6 @@ func TestGetMetrics(t *testing.T) { ElementsPinnedMemoryCache: 0, ElementsMemoryCache: 1, SizePinnedMemoryCache: 0, - SizeMemoryCache: 3432787, + SizeMemoryCache: 2953616, }, metrics) } diff --git a/libwasmvm/Cargo.lock b/libwasmvm/Cargo.lock index 89a7dfdbf..13e4615bb 100644 --- a/libwasmvm/Cargo.lock +++ b/libwasmvm/Cargo.lock @@ -2,11 +2,11 @@ # It is not intended for manual editing. [[package]] name = "addr2line" -version = "0.14.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" dependencies = [ - "gimli 0.23.0", + "gimli", ] [[package]] @@ -43,15 +43,16 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.56" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" +checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" dependencies = [ "addr2line", - "cfg-if 1.0.0", + "cc", + "cfg-if", "libc", "miniz_oxide", - "object 0.23.0", + "object", "rustc-demangle", ] @@ -61,16 +62,6 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" -[[package]] -name = "bincode" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d175dfa69e619905c4c3cdb7c3c203fa3bdd5d51184e3afdb2742c0280493772" -dependencies = [ - "byteorder", - "serde", -] - [[package]] name = "bitflags" version = "1.2.1" @@ -99,9 +90,9 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cbindgen" @@ -124,15 +115,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" - -[[package]] -name = "cfg-if" -version = "0.1.10" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" [[package]] name = "cfg-if" @@ -169,8 +154,8 @@ checksum = "9f6b64db6932c7e49332728e3a6bd82c6b7e16016607d20923b537c3bc4c0d5f" [[package]] name = "cosmwasm-crypto" -version = "0.14.0" -source = "git+https://github.com/CosmWasm/cosmwasm?rev=v0.14.0#b82b655ca9acf405a52f563f8490bd29c957abc6" +version = "0.15.0-alpha3" +source = "git+https://github.com/CosmWasm/cosmwasm?rev=v0.15.0-alpha3#ff66d1bab094cccd72b12fa165e1f817732ed289" dependencies = [ "digest", "ed25519-zebra", @@ -181,16 +166,16 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "0.14.0" -source = "git+https://github.com/CosmWasm/cosmwasm?rev=v0.14.0#b82b655ca9acf405a52f563f8490bd29c957abc6" +version = "0.15.0-alpha3" +source = "git+https://github.com/CosmWasm/cosmwasm?rev=v0.15.0-alpha3#ff66d1bab094cccd72b12fa165e1f817732ed289" dependencies = [ "syn", ] [[package]] name = "cosmwasm-std" -version = "0.14.0" -source = "git+https://github.com/CosmWasm/cosmwasm?rev=v0.14.0#b82b655ca9acf405a52f563f8490bd29c957abc6" +version = "0.15.0-alpha3" +source = "git+https://github.com/CosmWasm/cosmwasm?rev=v0.15.0-alpha3#ff66d1bab094cccd72b12fa165e1f817732ed289" dependencies = [ "base64", "cosmwasm-crypto", @@ -199,17 +184,19 @@ dependencies = [ "serde", "serde-json-wasm", "thiserror", + "uint", ] [[package]] name = "cosmwasm-vm" -version = "0.14.0" -source = "git+https://github.com/CosmWasm/cosmwasm?rev=v0.14.0#b82b655ca9acf405a52f563f8490bd29c957abc6" +version = "0.15.0-alpha3" +source = "git+https://github.com/CosmWasm/cosmwasm?rev=v0.15.0-alpha3#ff66d1bab094cccd72b12fa165e1f817732ed289" dependencies = [ "clru", "cosmwasm-crypto", "cosmwasm-std", "hex", + "loupe", "parity-wasm", "schemars", "serde", @@ -222,46 +209,44 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" +checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" dependencies = [ "libc", ] [[package]] name = "cranelift-bforest" -version = "0.68.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9221545c0507dc08a62b2d8b5ffe8e17ac580b0a74d1813b496b8d70b070fbd0" +checksum = "c8ca3560686e7c9c7ed7e0fe77469f2410ba5d7781b1acaa9adc8d8deea28e3e" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.68.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9936ea608b6cd176f107037f6adbb4deac933466fc7231154f96598b2d3ab1" +checksum = "baf9bf1ffffb6ce3d2e5ebc83549bd2436426c99b31cc550d521364cbe35d276" dependencies = [ - "byteorder", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.22.0", + "gimli", "log", "regalloc", "smallvec", "target-lexicon", - "thiserror", ] [[package]] name = "cranelift-codegen-meta" -version = "0.68.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef2b2768568306540f4c8db3acce9105534d34c4a1e440529c1e702d7f8c8d7" +checksum = "4cc21936a5a6d07e23849ffe83e5c1f6f50305c074f4b2970ca50c13bf55b821" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -269,24 +254,21 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.68.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6759012d6d19c4caec95793f052613e9d4113e925e7f14154defbac0f1d4c938" +checksum = "ca5b6ffaa87560bebe69a5446449da18090b126037920b0c1c6d5945f72faf6b" [[package]] name = "cranelift-entity" -version = "0.68.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86badbce14e15f52a45b666b38abe47b204969dd7f8fb7488cb55dd46b361fa6" -dependencies = [ - "serde", -] +checksum = "7d6b4a8bef04f82e4296782646f733c641d09497df2fabf791323fefaa44c64c" [[package]] name = "cranelift-frontend" -version = "0.68.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b608bb7656c554d0a4cf8f50c7a10b857e80306f6ff829ad6d468a7e2323c8d8" +checksum = "c31b783b351f966fce33e3c03498cb116d16d97a8f9978164a60920bd0d3a99c" dependencies = [ "cranelift-codegen", "log", @@ -300,16 +282,16 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -319,18 +301,18 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" +checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "lazy_static", "memoffset", @@ -339,15 +321,20 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "autocfg", - "cfg-if 1.0.0", + "cfg-if", "lazy_static", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-mac" version = "0.10.0" @@ -360,9 +347,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.0.2" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" +checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" dependencies = [ "byteorder", "digest", @@ -373,9 +360,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.12.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06d4a9551359071d1890820e3571252b91229e0712e7c36b08940e603c5a8fc" +checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" dependencies = [ "darling_core", "darling_macro", @@ -383,9 +370,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.12.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b443e5fb0ddd56e0c9bfa47dc060c5306ee500cb731f2b91432dd65589a77684" +checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" dependencies = [ "fnv", "ident_case", @@ -397,9 +384,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.12.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0220073ce504f12a70efc4e7cdaea9e9b1b324872e7ad96a208056d7a638b81" +checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ "darling_core", "quote", @@ -432,9 +419,9 @@ checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" [[package]] name = "dynasm" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7d1242462849390bb2ad38aeed769499f1afc7383affa2ab0c1baa894c0200" +checksum = "cdc2d9a5e44da60059bd38db2d05cbb478619541b8c79890547861ec1e3194f0" dependencies = [ "bitflags", "byteorder", @@ -447,9 +434,9 @@ dependencies = [ [[package]] name = "dynasmrt" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dd4d1d5ca12258cef339a57a7643e8b233a42dea9bb849630ddd9dd7726aa9" +checksum = "42276e3f205fe63887cca255aa9a65a63fb72764c30b9a6252a7c7e46994f689" dependencies = [ "byteorder", "dynasm", @@ -598,39 +585,33 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] name = "gimli" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" +checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" dependencies = [ "fallible-iterator", "indexmap", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" - [[package]] name = "group" version = "0.8.0" @@ -650,9 +631,9 @@ checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] @@ -707,13 +688,14 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "k256" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf02ecc966e1b7e8db1c81ac8f321ba24d1cfab5b634961fab10111f015858e1" +checksum = "4476a0808212a9e81ce802eb1a0cfc60e73aea296553bacc0fac7e1268bc572a" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", + "sha2", ] [[package]] @@ -730,17 +712,17 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "libc" -version = "0.2.88" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a" +checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" [[package]] name = "libloading" -version = "0.6.7" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" +checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] @@ -750,7 +732,28 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", +] + +[[package]] +name = "loupe" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" +dependencies = [ + "indexmap", + "loupe-derive", + "rustversion", +] + +[[package]] +name = "loupe-derive" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +dependencies = [ + "quote", + "syn", ] [[package]] @@ -762,20 +765,26 @@ dependencies = [ "libc", ] +[[package]] +name = "memchr" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" + [[package]] name = "memmap2" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" +checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" dependencies = [ "libc", ] [[package]] name = "memoffset" -version = "0.6.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" +checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" dependencies = [ "autocfg", ] @@ -808,20 +817,15 @@ dependencies = [ [[package]] name = "object" -version = "0.22.0" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" dependencies = [ "crc32fast", "indexmap", + "memchr", ] -[[package]] -name = "object" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" - [[package]] name = "opaque-debug" version = "0.3.0" @@ -881,13 +885,33 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" dependencies = [ "unicode-xid", ] +[[package]] +name = "ptr_meta" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7424255320182a46c403331afed6f95e0259a7c578f9da54a27e262ef3b60118" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53005b9863728f508d3f23ae37e03d60986a01b65f7ae8397dcebaa1d5e54e10" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "quote" version = "1.0.9" @@ -905,24 +929,24 @@ checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" [[package]] name = "rand" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.2", + "rand_core 0.6.3", "rand_hc", ] [[package]] name = "rand_chacha" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -936,27 +960,27 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.3", ] [[package]] name = "rand_hc" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" dependencies = [ - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] name = "rayon" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ "autocfg", "crossbeam-deque", @@ -966,9 +990,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -979,9 +1003,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" dependencies = [ "bitflags", ] @@ -1018,11 +1042,34 @@ dependencies = [ "winapi", ] +[[package]] +name = "rkyv" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb135b3e5e3311f0a254bfb00333f4bac9ef1d89888b84242a89eb8722b09a07" +dependencies = [ + "memoffset", + "ptr_meta", + "rkyv_derive", + "seahash", +] + +[[package]] +name = "rkyv_derive" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8f489f6b6d8551bb15904293c1ad58a6abafa7d8390d15f7ed05a2afcd87d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "rustc-demangle" -version = "0.1.18" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" [[package]] name = "rustc-hash" @@ -1030,6 +1077,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustversion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" + [[package]] name = "ryu" version = "1.0.5" @@ -1066,11 +1119,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "serde" -version = "1.0.124" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd761ff957cb2a45fbb9ab3da6512de9de55872866160b23c25f1a841e99d29f" +checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" dependencies = [ "serde_derive", ] @@ -1095,9 +1154,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.124" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b" +checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" dependencies = [ "proc-macro2", "quote", @@ -1133,7 +1192,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" dependencies = [ "block-buffer", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", "opaque-debug", @@ -1161,6 +1220,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.8.0" @@ -1181,9 +1246,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.63" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd9bc7ccc2688b3344c2f48b9b546648b25ce0b20fc717ee7fa7981a8ca9717" +checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" dependencies = [ "proc-macro2", "quote", @@ -1192,9 +1257,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422045212ea98508ae3d28025bc5aaa2bd4a9cdaecd442a08da2ee620ee9ea95" +checksum = "64ae3b39281e4b14b8123bdbaddd472b7dfe215e444181f2f9d2443c2444f834" [[package]] name = "tempfile" @@ -1202,7 +1267,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "rand", "redox_syscall", @@ -1221,18 +1286,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" dependencies = [ "proc-macro2", "quote", @@ -1250,11 +1315,11 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" +checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1262,9 +1327,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.13" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a9bd1db7706f2373a190b0d067146caa39350c486f3d455b0e33b431f94c07" +checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" dependencies = [ "proc-macro2", "quote", @@ -1273,18 +1338,30 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" dependencies = [ "lazy_static", ] [[package]] name = "typenum" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" + +[[package]] +name = "uint" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] [[package]] name = "unicode-segmentation" @@ -1300,9 +1377,9 @@ checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "vec_map" @@ -1312,9 +1389,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "wasi" @@ -1330,12 +1407,13 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasmer" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70cfae554988d904d64ca17ab0e7cd652ee5c8a0807094819c1ea93eb9d6866" +checksum = "7f52e455a01d0fac439cd7a96ba9b519bdc84e923a5b96034054697ebb17cd75" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "indexmap", + "loupe", "more-asserts", "target-lexicon", "thiserror", @@ -1344,21 +1422,22 @@ dependencies = [ "wasmer-compiler-singlepass", "wasmer-derive", "wasmer-engine", - "wasmer-engine-jit", - "wasmer-engine-native", + "wasmer-engine-dylib", + "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "wat", "winapi", ] [[package]] name = "wasmer-compiler" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7732a9cab472bd921d5a0c422f45b3d03f62fa2c40a89e0770cef6d47e383e" +checksum = "cc86dda6f715f03104800be575a38382b35c3962953af9e9d8722dcf0bd2458f" dependencies = [ "enumset", + "loupe", + "rkyv", "serde", "serde_bytes", "smallvec", @@ -1371,16 +1450,17 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb9395f094e1d81534f4c5e330ed4cdb424e8df870d29ad585620284f5fddb" +checksum = "1a570746cbec434179e2d53357973a34dfdb208043104e8fac3b7b0023015cf6" dependencies = [ "cranelift-codegen", + "cranelift-entity", "cranelift-frontend", - "gimli 0.22.0", + "gimli", + "loupe", "more-asserts", "rayon", - "serde", "smallvec", "tracing", "wasmer-compiler", @@ -1390,17 +1470,17 @@ dependencies = [ [[package]] name = "wasmer-compiler-singlepass" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426ae6ef0f606ca815510f3e2ef6f520e217514bfb7a664defe180b9a9e75d07" +checksum = "9429b9f7708c582d855b1787f09c7029ff23fb692550d4a1cc351c8ea84c3014" dependencies = [ "byteorder", "dynasm", "dynasmrt", "lazy_static", + "loupe", "more-asserts", "rayon", - "serde", "smallvec", "wasmer-compiler", "wasmer-types", @@ -1409,9 +1489,9 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b86dcd2c3efdb8390728a2b56f762db07789aaa5aa872a9dc776ba3a7912ed" +checksum = "1ee7b351bcc1e782997c72dc0b5b328f3ddcad4813b8ce3cac3f25ae5a4ab56b" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1421,13 +1501,13 @@ dependencies = [ [[package]] name = "wasmer-engine" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efe4667d6bd888f26ae8062a63a9379fa697415b4b4e380f33832e8418fd71b5" +checksum = "8454ead320a4017ba36ddd9ab4fbf7776fceea6ab0b79b5e53664a1682569fc3" dependencies = [ "backtrace", - "bincode", "lazy_static", + "loupe", "memmap2", "more-asserts", "rustc-demangle", @@ -1441,50 +1521,52 @@ dependencies = [ ] [[package]] -name = "wasmer-engine-jit" -version = "1.0.2" +name = "wasmer-engine-dylib" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26770be802888011b4a3072f2a282fc2faa68aa48c71b3db6252a3937a85f3da" +checksum = "6aa390d123ebe23d5315c39f6063fcc18319661d03c8000f23d0fe1c011e8135" dependencies = [ - "bincode", - "cfg-if 0.1.10", - "region", + "cfg-if", + "leb128", + "libloading", + "loupe", + "rkyv", "serde", - "serde_bytes", + "tempfile", + "tracing", "wasmer-compiler", "wasmer-engine", + "wasmer-object", "wasmer-types", "wasmer-vm", - "winapi", + "which", ] [[package]] -name = "wasmer-engine-native" -version = "1.0.2" +name = "wasmer-engine-universal" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb4083a6c69f2cd4b000b82a80717f37c6cc2e536aee3a8ffe9af3edc276a8b" +checksum = "0dffe8015f08915eb4939ebc8e521cde8246f272f5197ea60d46214ac5aef285" dependencies = [ - "bincode", - "cfg-if 0.1.10", + "cfg-if", "leb128", - "libloading", - "serde", - "tempfile", - "tracing", + "loupe", + "region", + "rkyv", "wasmer-compiler", "wasmer-engine", - "wasmer-object", "wasmer-types", "wasmer-vm", - "which", + "winapi", ] [[package]] name = "wasmer-middlewares" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547baee2c0733cf436db7d137a8d1f86737a6321fc0fe6cd74caecf6f759c3c4" +checksum = "95d2b4722d64c850893f7a7eab3ab76181efbafcd366827801d8bcd64bff525f" dependencies = [ + "loupe", "wasmer", "wasmer-types", "wasmer-vm", @@ -1492,11 +1574,11 @@ dependencies = [ [[package]] name = "wasmer-object" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf8e0c12b82ff81ebecd30d7e118be5fec871d6de885a90eeb105df0a769a7b" +checksum = "c541c985799fc1444702501c15d41becfb066c92d9673defc1c7417fd8739e15" dependencies = [ - "object 0.22.0", + "object", "thiserror", "wasmer-compiler", "wasmer-types", @@ -1504,29 +1586,33 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f4ac28c2951cd792c18332f03da523ed06b170f5cf6bb5b1bdd7e36c2a8218" +checksum = "c91f75d3c31f8b1f8d818ff49624fc974220243cbc07a2252f408192e97c6b51" dependencies = [ - "cranelift-entity", + "indexmap", + "loupe", + "rkyv", "serde", "thiserror", ] [[package]] name = "wasmer-vm" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7635ba0b6d2fd325f588d69a950ad9fa04dddbf6ad08b6b2a183146319bf6ae" +checksum = "469a12346a4831e7dac639b9646d8c9b24c7d2cf0cf458b77f489edb35060c1f" dependencies = [ "backtrace", "cc", - "cfg-if 0.1.10", + "cfg-if", "indexmap", "libc", + "loupe", "memoffset", "more-asserts", "region", + "rkyv", "serde", "thiserror", "wasmer-types", @@ -1535,9 +1621,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.65.0" +version = "0.78.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc2fe6350834b4e528ba0901e7aa405d78b89dc1fa3145359eb4de0e323fcf" +checksum = "52144d4c78e5cf8b055ceab8e5fa22814ce4315d6002ad32cfd914f37c12fd65" [[package]] name = "wasmvm" @@ -1554,32 +1640,14 @@ dependencies = [ "thiserror", ] -[[package]] -name = "wast" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5ae96da18bb5926341516fd409b5a8ce4e4714da7f0a1063d3b20ac9f9a1e1" -dependencies = [ - "leb128", -] - -[[package]] -name = "wat" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0fa059022c5dabe129f02b429d67086400deb8277f89c975555dacc1dadbcc" -dependencies = [ - "wast", -] - [[package]] name = "which" -version = "4.0.2" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" dependencies = [ + "either", "libc", - "thiserror", ] [[package]] @@ -1612,6 +1680,6 @@ checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" [[package]] name = "zeroize" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" diff --git a/libwasmvm/Cargo.toml b/libwasmvm/Cargo.toml index 5f9191a15..1cd2e96bb 100644 --- a/libwasmvm/Cargo.toml +++ b/libwasmvm/Cargo.toml @@ -26,8 +26,8 @@ default = [] backtraces = [] [dependencies] -cosmwasm-std = { git = "https://github.com/CosmWasm/cosmwasm", rev = "v0.14.0", features = ["iterator", "staking", "stargate"] } -cosmwasm-vm = { git = "https://github.com/CosmWasm/cosmwasm", rev = "v0.14.0", features = ["iterator", "staking", "stargate"] } +cosmwasm-std = { git = "https://github.com/CosmWasm/cosmwasm", rev = "v0.15.0-alpha3", features = ["iterator", "staking", "stargate"] } +cosmwasm-vm = { git = "https://github.com/CosmWasm/cosmwasm", rev = "v0.15.0-alpha3", features = ["iterator", "staking", "stargate"] } errno = "0.2" serde_json = "1.0" thiserror = "1.0" diff --git a/libwasmvm/src/cache.rs b/libwasmvm/src/cache.rs index 512c3e58d..ec5f19717 100644 --- a/libwasmvm/src/cache.rs +++ b/libwasmvm/src/cache.rs @@ -365,7 +365,7 @@ mod tests { #[test] fn init_cache_writes_error() { - let dir: String = String::from("borken\0dir"); // null bytes are valid UTF8 but not allowed in FS paths + let dir: String = String::from("broken\0dir"); // null bytes are valid UTF8 but not allowed in FS paths let features = b"staking"; let mut error_msg = UnmanagedVector::default(); @@ -379,7 +379,7 @@ mod tests { assert!(cache_ptr.is_null()); assert_eq!(error_msg.is_some(), true); let msg = String::from_utf8(error_msg.consume().unwrap()).unwrap(); - assert_eq!(msg, "Error calling the VM: Cache error: Error creating Wasm dir for cache: data provided contains a nul byte"); + assert_eq!(msg, "Error calling the VM: Cache error: Error creating directory broken\u{0}dir/state: data provided contains a nul byte"); } #[test] @@ -685,7 +685,7 @@ mod tests { misses: 0, elements_pinned_memory_cache: 1, elements_memory_cache: 0, - size_pinned_memory_cache: 3432787, + size_pinned_memory_cache: 2953616, size_memory_cache: 0, } ); diff --git a/types/ibc.go b/types/ibc.go index d74559dda..f65f421a7 100644 --- a/types/ibc.go +++ b/types/ibc.go @@ -48,6 +48,10 @@ type IBCTimeout struct { Timestamp uint64 `json:"timestamp,string,omitempty"` } +type IBCAcknowledgement struct { + Data []byte `json:"data"` +} + type IBCPacket struct { Data []byte `json:"data"` Src IBCEndpoint `json:"src"` @@ -56,9 +60,9 @@ type IBCPacket struct { Timeout IBCTimeout `json:"timeout"` } -type IBCAcknowledgement struct { - Acknowledgement []byte `json:"acknowledgement"` - OriginalPacket IBCPacket `json:"original_packet"` +type IBCAcknowledgementWithPacket struct { + Acknowledgement IBCAcknowledgement `json:"acknowledgement"` + OriginalPacket IBCPacket `json:"original_packet"` } // IBCChannelOpenResult is the raw response from the ibc_channel_open call. @@ -84,11 +88,11 @@ type IBCBasicResult struct { // IBCBasicResponse defines the return value on a successful processing. // This is the counterpart of [IbcBasicResponse](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta1/packages/std/src/ibc.rs#L194-L216). type IBCBasicResponse struct { - // Submessages are like Messages, but they guarantee a reply to the calling contract - // after their execution, and return both success and error rather than auto-failing on error - Submessages []SubMsg `json:"submessages"` - // Messages comes directly from the contract and is it's request for action - Messages []CosmosMsg `json:"messages"` + // Messages comes directly from the contract and is its request for action. + // If the ReplyOn value matches the result, the runtime will invoke this + // contract's `reply` entry point after execution. Otherwise, this is all + // "fire and forget". + Messages []SubMsg `json:"messages"` // attributes for a log event to return over abci interface Attributes []EventAttribute `json:"attributes"` } diff --git a/types/msg.go b/types/msg.go index 0c0d8c31b..fd720a557 100644 --- a/types/msg.go +++ b/types/msg.go @@ -2,6 +2,7 @@ package types import ( "encoding/json" + "fmt" ) //------- Results / Msgs ------------- @@ -16,15 +17,18 @@ type ContractResult struct { // Response defines the return value on a successful instantiate/execute/migrate. // This is the counterpart of [Response](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta1/packages/std/src/results/response.rs#L73-L88) type Response struct { - // Submessages are like Messages, but they guarantee a reply to the calling contract - // after their execution, and return both success and error rather than auto-failing on error - Submessages []SubMsg `json:"submessages"` - // Messages comes directly from the contract and is it's request for action - Messages []CosmosMsg `json:"messages"` + // Messages comes directly from the contract and is its request for action. + // If the ReplyOn value matches the result, the runtime will invoke this + // contract's `reply` entry point after execution. Otherwise, this is all + // "fire and forget". + Messages []SubMsg `json:"messages"` // base64-encoded bytes to return as ABCI.Data field Data []byte `json:"data"` // attributes for a log event to return over abci interface Attributes []EventAttribute `json:"attributes"` + // custom events (separate from the main one that contains the attributes + // above) + Events []Event `json:"events"` } // EventAttributes must encode empty array as [] @@ -65,6 +69,7 @@ type CosmosMsg struct { Bank *BankMsg `json:"bank,omitempty"` Custom json.RawMessage `json:"custom,omitempty"` Distribution *DistributionMsg `json:"distribution,omitempty"` + Gov *GovMsg `json:"gov,omitempty"` IBC *IBCMsg `json:"ibc,omitempty"` Staking *StakingMsg `json:"staking,omitempty"` Stargate *StargateMsg `json:"stargate,omitempty"` @@ -96,6 +101,47 @@ type IBCMsg struct { CloseChannel *CloseChannelMsg `json:"close_channel,omitempty"` } +type GovMsg struct { + // This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address. + Vote VoteMsg `json:"vote,omitempty"` +} + +type VoteOption int + +type VoteMsg struct { + ProposalId uint64 `json:"proposal_id"` + Vote VoteOption `json:"vote"` +} + +const ( + Yes VoteOption = iota + No + Abstain + NoWithVeto +) + +var toVoteOption = map[string]VoteOption{ + "yes": Yes, + "no": No, + "abstain": Abstain, + "no_with_veto": NoWithVeto, +} + +func (s *VoteOption) UnmarshalJSON(b []byte) error { + var j string + err := json.Unmarshal(b, &j) + if err != nil { + return err + } + + voteOption, ok := toVoteOption[j] + if !ok { + return fmt.Errorf("invalid vote option '%v'", j) + } + *s = voteOption + return nil +} + type TransferMsg struct { ChannelID string `json:"channel_id"` ToAddress string `json:"to_address"` @@ -184,7 +230,7 @@ type ExecuteMsg struct { // as `userMsg` when calling `Handle` on the above-defined contract Msg []byte `json:"msg"` // Send is an optional amount of coins this contract sends to the called contract - Send Coins `json:"send"` + Funds Coins `json:"funds"` } // InstantiateMsg will create a new contract instance from a previously uploaded CodeID. @@ -196,7 +242,7 @@ type InstantiateMsg struct { // as `userMsg` when calling `Init` on a new contract with the above-defined CodeID Msg []byte `json:"msg"` // Send is an optional amount of coins this contract sends to the called contract - Send Coins `json:"send"` + Funds Coins `json:"funds"` // Label is optional metadata to be stored with a contract instance. Label string `json:"label"` // Admin (optional) may be set here to allow future migrations from this address