diff --git a/Cargo.lock b/Cargo.lock index 8a4521a3b6..65c783eb47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,7 +11,7 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] name = "abstract-domain-derive" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.36", @@ -390,7 +390,7 @@ dependencies = [ [[package]] name = "aptos-crypto" version = "0.0.3" -source = "git+https://github.com/starcoinorg/starcoin-crypto?rev=ca832ccccfd6f3df99620ee50003c9c2b2ffab69#ca832ccccfd6f3df99620ee50003c9c2b2ffab69" +source = "git+https://github.com/starcoinorg/starcoin-crypto?rev=9eeaeb7e30065cc97160de7a1b42fab6ae88058e#9eeaeb7e30065cc97160de7a1b42fab6ae88058e" dependencies = [ "aes-gcm 0.10.3", "anyhow", @@ -444,7 +444,7 @@ dependencies = [ [[package]] name = "aptos-crypto-derive" version = "0.0.3" -source = "git+https://github.com/starcoinorg/starcoin-crypto?rev=ca832ccccfd6f3df99620ee50003c9c2b2ffab69#ca832ccccfd6f3df99620ee50003c9c2b2ffab69" +source = "git+https://github.com/starcoinorg/starcoin-crypto?rev=9eeaeb7e30065cc97160de7a1b42fab6ae88058e#9eeaeb7e30065cc97160de7a1b42fab6ae88058e" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.36", @@ -5854,7 +5854,7 @@ checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" [[package]] name = "move-abigen" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "bcs 0.1.4", @@ -5871,7 +5871,7 @@ dependencies = [ [[package]] name = "move-binary-format" version = "0.0.3" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "arbitrary", @@ -5888,12 +5888,12 @@ dependencies = [ [[package]] name = "move-borrow-graph" version = "0.0.1" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" [[package]] name = "move-bytecode-source-map" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "bcs 0.1.4", @@ -5908,7 +5908,7 @@ dependencies = [ [[package]] name = "move-bytecode-utils" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "move-binary-format", @@ -5920,7 +5920,7 @@ dependencies = [ [[package]] name = "move-bytecode-verifier" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "fail", "move-binary-format", @@ -5934,7 +5934,7 @@ dependencies = [ [[package]] name = "move-bytecode-viewer" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "clap 4.5.13", @@ -5949,7 +5949,7 @@ dependencies = [ [[package]] name = "move-cli" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "clap 4.5.13", @@ -5979,7 +5979,7 @@ dependencies = [ [[package]] name = "move-command-line-common" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "difference", @@ -5996,7 +5996,7 @@ dependencies = [ [[package]] name = "move-compiler" version = "0.0.1" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6022,7 +6022,7 @@ dependencies = [ [[package]] name = "move-compiler-v2" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "abstract-domain-derive", "anyhow", @@ -6053,7 +6053,7 @@ dependencies = [ [[package]] name = "move-core-types" version = "0.0.4" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "arbitrary", @@ -6080,7 +6080,7 @@ dependencies = [ [[package]] name = "move-coverage" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6116,7 +6116,7 @@ dependencies = [ [[package]] name = "move-disassembler" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "clap 4.5.13", @@ -6133,7 +6133,7 @@ dependencies = [ [[package]] name = "move-docgen" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "clap 4.5.13", @@ -6152,7 +6152,7 @@ dependencies = [ [[package]] name = "move-errmapgen" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "move-command-line-common", @@ -6164,7 +6164,7 @@ dependencies = [ [[package]] name = "move-ir-compiler" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "bcs 0.1.4", @@ -6180,7 +6180,7 @@ dependencies = [ [[package]] name = "move-ir-to-bytecode" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "codespan-reporting", @@ -6198,7 +6198,7 @@ dependencies = [ [[package]] name = "move-ir-to-bytecode-syntax" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "hex", @@ -6211,7 +6211,7 @@ dependencies = [ [[package]] name = "move-ir-types" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "hex", "move-command-line-common", @@ -6224,7 +6224,7 @@ dependencies = [ [[package]] name = "move-model" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "codespan 0.11.1", @@ -6250,7 +6250,7 @@ dependencies = [ [[package]] name = "move-package" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "clap 4.5.13", @@ -6334,7 +6334,7 @@ dependencies = [ [[package]] name = "move-prover" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "atty", @@ -6361,7 +6361,7 @@ dependencies = [ [[package]] name = "move-prover-boogie-backend" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "async-trait", @@ -6390,7 +6390,7 @@ dependencies = [ [[package]] name = "move-prover-bytecode-pipeline" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "abstract-domain-derive", "anyhow", @@ -6407,7 +6407,7 @@ dependencies = [ [[package]] name = "move-prover-test-utils" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "move-command-line-common", @@ -6418,7 +6418,7 @@ dependencies = [ [[package]] name = "move-resource-viewer" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "hex", @@ -6431,7 +6431,7 @@ dependencies = [ [[package]] name = "move-stackless-bytecode" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "abstract-domain-derive", "codespan-reporting", @@ -6450,7 +6450,7 @@ dependencies = [ [[package]] name = "move-stdlib" version = "0.1.1" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "hex", @@ -6473,7 +6473,7 @@ dependencies = [ [[package]] name = "move-symbol-pool" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "once_cell", "serde", @@ -6482,7 +6482,7 @@ dependencies = [ [[package]] name = "move-table-extension" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "better_any", "bytes 1.6.1", @@ -6497,7 +6497,7 @@ dependencies = [ [[package]] name = "move-transactional-test-runner" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "clap 4.5.13", @@ -6529,7 +6529,7 @@ dependencies = [ [[package]] name = "move-unit-test" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "better_any", @@ -6557,7 +6557,7 @@ dependencies = [ [[package]] name = "move-vm-runtime" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "better_any", "bytes 1.6.1", @@ -6581,7 +6581,7 @@ dependencies = [ [[package]] name = "move-vm-test-utils" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "anyhow", "bytes 1.6.1", @@ -6597,7 +6597,7 @@ dependencies = [ [[package]] name = "move-vm-types" version = "0.1.0" -source = "git+https://github.com/starcoinorg/move?rev=a5e99a08dc30a72723556bc678a318a1f9783891#a5e99a08dc30a72723556bc678a318a1f9783891" +source = "git+https://github.com/starcoinorg/move?rev=3486a4d205a2dcb92e49904e7c97114a6478e2ec#3486a4d205a2dcb92e49904e7c97114a6478e2ec" dependencies = [ "bcs 0.1.4", "derivative", @@ -7264,7 +7264,7 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openrpc-derive" version = "0.1.0" -source = "git+https://github.com/starcoinorg/openrpc-rs?rev=f8ab047e30927cdf2f605b61a219c975d6c4f666#f8ab047e30927cdf2f605b61a219c975d6c4f666" +source = "git+https://github.com/starcoinorg/openrpc-rs?rev=1f2f7d3495e3bd3ef3b6fcf7c4e0602cad090d5e#1f2f7d3495e3bd3ef3b6fcf7c4e0602cad090d5e" dependencies = [ "jsonrpc-core-client 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-derive 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7278,7 +7278,7 @@ dependencies = [ [[package]] name = "openrpc-schema" version = "0.1.0" -source = "git+https://github.com/starcoinorg/openrpc-rs?rev=f8ab047e30927cdf2f605b61a219c975d6c4f666#f8ab047e30927cdf2f605b61a219c975d6c4f666" +source = "git+https://github.com/starcoinorg/openrpc-rs?rev=1f2f7d3495e3bd3ef3b6fcf7c4e0602cad090d5e#1f2f7d3495e3bd3ef3b6fcf7c4e0602cad090d5e" dependencies = [ "schemars", "serde", @@ -9325,8 +9325,9 @@ dependencies = [ [[package]] name = "schemars" version = "0.8.8" -source = "git+https://github.com/starcoinorg/schemars?rev=9b3705780b8fe9c8676ff82919869ba7405b1062#9b3705780b8fe9c8676ff82919869ba7405b1062" +source = "git+https://github.com/starcoinorg/schemars?rev=a64c6ddf7ca4796e090208b1476de2e53772042f#a64c6ddf7ca4796e090208b1476de2e53772042f" dependencies = [ + "bytes 1.6.1", "dyn-clone", "multiaddr", "schemars_derive", @@ -9337,7 +9338,7 @@ dependencies = [ [[package]] name = "schemars_derive" version = "0.8.8" -source = "git+https://github.com/starcoinorg/schemars?rev=9b3705780b8fe9c8676ff82919869ba7405b1062#9b3705780b8fe9c8676ff82919869ba7405b1062" +source = "git+https://github.com/starcoinorg/schemars?rev=a64c6ddf7ca4796e090208b1476de2e53772042f#a64c6ddf7ca4796e090208b1476de2e53772042f" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.36", @@ -10558,7 +10559,7 @@ dependencies = [ [[package]] name = "starcoin-crypto" version = "1.10.0-rc.2" -source = "git+https://github.com/starcoinorg/starcoin-crypto?rev=ca832ccccfd6f3df99620ee50003c9c2b2ffab69#ca832ccccfd6f3df99620ee50003c9c2b2ffab69" +source = "git+https://github.com/starcoinorg/starcoin-crypto?rev=9eeaeb7e30065cc97160de7a1b42fab6ae88058e#9eeaeb7e30065cc97160de7a1b42fab6ae88058e" dependencies = [ "anyhow", "aptos-crypto", @@ -10577,7 +10578,7 @@ dependencies = [ [[package]] name = "starcoin-crypto-macro" version = "1.10.0-rc.2" -source = "git+https://github.com/starcoinorg/starcoin-crypto?rev=ca832ccccfd6f3df99620ee50003c9c2b2ffab69#ca832ccccfd6f3df99620ee50003c9c2b2ffab69" +source = "git+https://github.com/starcoinorg/starcoin-crypto?rev=9eeaeb7e30065cc97160de7a1b42fab6ae88058e#9eeaeb7e30065cc97160de7a1b42fab6ae88058e" dependencies = [ "proc-macro2 1.0.86", "quote 1.0.36", @@ -10713,7 +10714,7 @@ dependencies = [ "anyhow", "clap 3.2.23", "itertools 0.10.5", - "rand 0.8.5", + "rand 0.7.3", "rayon", "starcoin-accumulator", "starcoin-config", @@ -11618,6 +11619,7 @@ dependencies = [ "anyhow", "async-trait", "bcs-ext", + "bytes 1.6.1", "clap 3.2.23", "futures 0.3.30", "hex", @@ -11731,6 +11733,7 @@ dependencies = [ "api-limiter", "bcs 0.1.5", "bcs-ext", + "bytes 1.6.1", "dashmap", "futures 0.3.30", "futures-channel", diff --git a/Cargo.toml b/Cargo.toml index dfb391dbe8..5218081770 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -358,10 +358,10 @@ jsonrpc-client-transports = "18" jsonrpc-core = "18" jsonrpc-core-client = "18" jsonrpc-derive = "18" -openrpc-derive = { git = "https://github.com/starcoinorg/openrpc-rs", rev = "f8ab047e30927cdf2f605b61a219c975d6c4f666", features = [ +openrpc-derive = { git = "https://github.com/starcoinorg/openrpc-rs", rev = "1f2f7d3495e3bd3ef3b6fcf7c4e0602cad090d5e", features = [ "jsonrpc", ] } -openrpc-schema = { git = "https://github.com/starcoinorg/openrpc-rs", rev = "f8ab047e30927cdf2f605b61a219c975d6c4f666" } +openrpc-schema = { git = "https://github.com/starcoinorg/openrpc-rs", rev = "1f2f7d3495e3bd3ef3b6fcf7c4e0602cad090d5e" } jsonrpc-http-server = "18" jsonrpc-ipc-server = "18" @@ -402,37 +402,37 @@ sha2_0_10_6 = { package = "sha2", version = "0.10.6" } siphasher = "0.3.10" merkletree = { version = "0.22.1" } mirai-annotations = "1.10.1" -move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-bytecode-source-map = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-bytecode-verifier = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-cli = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-command-line-common = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-compiler = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-compiler-v2 = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-core-types = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-coverage = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-disassembler = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-docgen = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-errmapgen = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-ir-compiler = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-ir-types = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-model = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-package = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-prover = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-prover-boogie-backend = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-prover-bytecode-pipeline = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-stackless-bytecode = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-prover-test-utils = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-resource-viewer = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-stdlib = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-transactional-test-runner = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-unit-test = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891", features = [ +move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-bytecode-source-map = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-bytecode-verifier = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-cli = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-command-line-common = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-compiler = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-compiler-v2 = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-core-types = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-coverage = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-disassembler = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-docgen = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-errmapgen = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-ir-compiler = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-ir-types = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-model = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-package = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-prover = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-prover-boogie-backend = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-prover-bytecode-pipeline = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-stackless-bytecode = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-prover-test-utils = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-resource-viewer = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-stdlib = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-transactional-test-runner = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-unit-test = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec", features = [ "table-extension", ] } -move-vm-runtime = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-vm-types = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-table-extension = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891" } -move-vm-test-utils = { git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891", features = [ +move-vm-runtime = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-vm-types = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-table-extension = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec" } +move-vm-test-utils = { git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec", features = [ "table-extension", ] } @@ -479,7 +479,7 @@ rustc-serialize = "0.3.25" rustyline = "9.1.2" rustyline-derive = "0.6.0" sc-peerset = { path = "network-p2p/peerset" } -schemars = { git = "https://github.com/starcoinorg/schemars", rev = "9b3705780b8fe9c8676ff82919869ba7405b1062" } +schemars = { git = "https://github.com/starcoinorg/schemars", rev = "a64c6ddf7ca4796e090208b1476de2e53772042f" } scmd = { path = "commons/scmd" } serde = { version = "1.0.130", features = ["derive"] } serde-generate = { git = "https://github.com/starcoinorg/serde-reflection", rev = "eb95fd4e3b67e08d71432b522c53833a0b855d80" } @@ -518,7 +518,7 @@ starcoin-chain-service = { path = "chain/service" } starcoin-cmd = { path = "cmd/starcoin" } starcoin-config = { path = "config" } starcoin-consensus = { path = "consensus" } -starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev = "ca832ccccfd6f3df99620ee50003c9c2b2ffab69" } +starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev = "9eeaeb7e30065cc97160de7a1b42fab6ae88058e" } starcoin-decrypt = { path = "commons/decrypt" } starcoin-dev = { path = "vm/dev" } @@ -614,7 +614,7 @@ unsigned-varint = { version = "0.6.0", features = [ "futures", "asynchronous_codec", ] } -vm = { package = "move-binary-format", git = "https://github.com/starcoinorg/move", rev = "a5e99a08dc30a72723556bc678a318a1f9783891", features = [ +vm = { package = "move-binary-format", git = "https://github.com/starcoinorg/move", rev = "3486a4d205a2dcb92e49904e7c97114a6478e2ec", features = [ "fuzzing", ] } vm-status-translator = { path = "vm/vm-status-translator" } diff --git a/etc/starcoin_types.yml b/etc/starcoin_types.yml index 11fa56f2ed..2d153a0695 100644 --- a/etc/starcoin_types.yml +++ b/etc/starcoin_types.yml @@ -224,10 +224,12 @@ StateKey: STRUCT: - handle: TYPENAME: TableHandle - - key: BYTES + - key: + SEQ: U8 2: Raw: - NEWTYPE: BYTES + NEWTYPE: + SEQ: U8 StateValueMetadata: ENUM: 0: diff --git a/executor/benchmark/Cargo.toml b/executor/benchmark/Cargo.toml index 51975179e2..57ae3c08bf 100644 --- a/executor/benchmark/Cargo.toml +++ b/executor/benchmark/Cargo.toml @@ -2,7 +2,7 @@ anyhow = { workspace = true } clap = { features = ["derive"], workspace = true } itertools = { features = ["use_alloc"], workspace = true } -rand = { workspace = true } +rand_0_7_3 = { workspace = true } rayon = { workspace = true } starcoin-accumulator = { workspace = true } starcoin-crypto = { workspace = true } diff --git a/executor/benchmark/src/lib.rs b/executor/benchmark/src/lib.rs index 7d4ed2cb1d..7a26a3943b 100644 --- a/executor/benchmark/src/lib.rs +++ b/executor/benchmark/src/lib.rs @@ -1,7 +1,7 @@ // Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 -use rand::{rngs::StdRng, SeedableRng}; +use rand_0_7_3::{prelude::StdRng, SeedableRng}; use starcoin_config::ChainNetwork; use starcoin_crypto::keygen::KeyGen; use starcoin_crypto::{ @@ -171,7 +171,7 @@ impl TransactionGenerator { transactions.push(Transaction::BlockMetadata(block_meta)); for j in 0..block_size { - let indices = rand::seq::index::sample(&mut self.rng, self.accounts.len(), 1); + let indices = rand_0_7_3::seq::index::sample(&mut self.rng, self.accounts.len(), 1); // let sender_idx = indices.index(0); let receiver_idx = indices.index(0); @@ -207,7 +207,7 @@ struct TxnExecutor<'test, S> { block_receiver: mpsc::Receiver>, } -impl<'test, S: ChainStateReader + ChainStateWriter> TxnExecutor<'test, S> { +impl<'test, S: ChainStateReader + ChainStateWriter + Sync> TxnExecutor<'test, S> { fn new(chain_state: &'test S, block_receiver: mpsc::Receiver>) -> Self { Self { chain_state, diff --git a/rpc/api/Cargo.toml b/rpc/api/Cargo.toml index dcbff09b70..10cfe3e67d 100644 --- a/rpc/api/Cargo.toml +++ b/rpc/api/Cargo.toml @@ -5,6 +5,7 @@ path = "src/generate_schema.rs" [dependencies] anyhow = { workspace = true } async-trait = { workspace = true } +bytes = { workspace = true } bcs-ext = { workspace = true } clap = { features = ["derive"], workspace = true } futures = { workspace = true } diff --git a/rpc/api/src/state/mod.rs b/rpc/api/src/state/mod.rs index f6c8500e66..eefee4b95a 100644 --- a/rpc/api/src/state/mod.rs +++ b/rpc/api/src/state/mod.rs @@ -7,35 +7,35 @@ use crate::types::{ StateWithProofView, StateWithTableItemProofView, StrView, StructTagView, TableInfoView, }; use crate::FutureResult; +use bytes::Bytes; use openrpc_derive::openrpc; use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; use starcoin_crypto::HashValue; use starcoin_types::language_storage::{ModuleId, StructTag}; -use starcoin_types::{ - access_path::AccessPath, account_address::AccountAddress, account_state::AccountState, -}; +use starcoin_types::{account_address::AccountAddress, account_state::AccountState}; +use starcoin_vm_types::state_store::state_key::StateKey; use starcoin_vm_types::state_store::table::TableHandle; #[openrpc] pub trait StateApi { #[rpc(name = "state.get")] - fn get(&self, access_path: AccessPath) -> FutureResult>>; + fn get(&self, state_key: StateKey) -> FutureResult>; /// Return state from StateTree storage directly by tree node key. #[rpc(name = "state.get_state_node_by_node_hash")] - fn get_state_node_by_node_hash(&self, key_hash: HashValue) -> FutureResult>>; + fn get_state_node_by_node_hash(&self, key_hash: HashValue) -> FutureResult>; /// Return the Resource Or Code at the `access_path`, and provide a State Proof. #[rpc(name = "state.get_with_proof")] - fn get_with_proof(&self, access_path: AccessPath) -> FutureResult; + fn get_with_proof(&self, state_key: StateKey) -> FutureResult; /// Same as `state.get_with_proof` but return `StateWithProof` in BCS serialize bytes. #[rpc(name = "state.get_with_proof_raw")] - fn get_with_proof_raw(&self, access_path: AccessPath) -> FutureResult>>; + fn get_with_proof_raw(&self, state_key: StateKey) -> FutureResult>>; #[rpc(name = "state.get_account_state")] - fn get_account_state(&self, address: AccountAddress) -> FutureResult>; + fn get_account_state(&self, address: AccountAddress) -> FutureResult; #[rpc(name = "state.get_account_state_set")] fn get_account_state_set( @@ -51,7 +51,7 @@ pub trait StateApi { #[rpc(name = "state.get_with_proof_by_root")] fn get_with_proof_by_root( &self, - access_path: AccessPath, + state_key: StateKey, state_root: HashValue, ) -> FutureResult; @@ -59,13 +59,13 @@ pub trait StateApi { #[rpc(name = "state.get_with_proof_by_root_raw")] fn get_with_proof_by_root_raw( &self, - access_path: AccessPath, + state_key: StateKey, state_root: HashValue, ) -> FutureResult>>; /// Return the TableInfo according to queried AccountAddress #[rpc(name = "state.get_table_info")] - fn get_table_info(&self, address: AccountAddress) -> FutureResult>; + fn get_table_info(&self, address: AccountAddress) -> FutureResult; /// Return the TableItem value and provide a State Proof at `state_root` #[rpc(name = "state.get_with_table_item_proof")] diff --git a/rpc/client/src/lib.rs b/rpc/client/src/lib.rs index a20424b8c1..6ac21ac5f2 100644 --- a/rpc/client/src/lib.rs +++ b/rpc/client/src/lib.rs @@ -59,6 +59,7 @@ use starcoin_types::sync_status::SyncStatus; use starcoin_types::system_events::MintBlockEvent; use starcoin_types::transaction::{RawUserTransaction, SignedUserTransaction}; use starcoin_vm_types::language_storage::{ModuleId, StructTag}; +use starcoin_vm_types::state_store::state_key::StateKey; use starcoin_vm_types::state_store::table::TableHandle; use starcoin_vm_types::token::token_code::TokenCode; use starcoin_vm_types::transaction::DryRunTransaction; @@ -501,28 +502,26 @@ impl RpcClient { RemoteStateReader::new(self, state_root_opt) } - pub fn state_get(&self, access_path: AccessPath) -> anyhow::Result>> { - self.call_rpc_blocking(|inner| inner.state_client.get(access_path)) + pub fn state_get(&self, state_key: StateKey) -> anyhow::Result>> { + self.call_rpc_blocking(|inner| inner.state_client.get(state_key)) .map_err(map_err) + .map(|v| v.map(|s| s.to_vec())) } - pub fn state_get_with_proof( - &self, - access_path: AccessPath, - ) -> anyhow::Result { - self.call_rpc_blocking(|inner| inner.state_client.get_with_proof(access_path)) + pub fn state_get_with_proof(&self, state_key: StateKey) -> anyhow::Result { + self.call_rpc_blocking(|inner| inner.state_client.get_with_proof(state_key)) .map_err(map_err) } pub fn state_get_with_proof_by_root( &self, - access_path: AccessPath, + state_key: StateKey, state_root: HashValue, ) -> anyhow::Result { self.call_rpc_blocking(|inner| { inner .state_client - .get_with_proof_by_root(access_path, state_root) + .get_with_proof_by_root(state_key, state_root) }) .map_err(map_err) } diff --git a/rpc/client/src/remote_state_reader.rs b/rpc/client/src/remote_state_reader.rs index 62c85984a4..280bfc0f8a 100644 --- a/rpc/client/src/remote_state_reader.rs +++ b/rpc/client/src/remote_state_reader.rs @@ -73,9 +73,9 @@ impl<'a> RemoteStateReader<'a> { } impl<'a> ChainStateReader for RemoteStateReader<'a> { - fn get_with_proof(&self, access_path: &AccessPath) -> Result { + fn get_with_proof(&self, state_key: &StateKey) -> Result { self.client - .state_get_with_proof_by_root(access_path.clone(), self.state_root) + .state_get_with_proof_by_root(state_key.clone(), self.state_root) .map(Into::into) } diff --git a/rpc/server/Cargo.toml b/rpc/server/Cargo.toml index f29ccd36f0..1bc76f63f5 100644 --- a/rpc/server/Cargo.toml +++ b/rpc/server/Cargo.toml @@ -68,6 +68,7 @@ thiserror = { workspace = true } vm-status-translator = { workspace = true } starcoin-vm-runtime = { workspace = true } starcoin-dag = { workspace = true } +bytes = { workspace = true } [dev-dependencies] starcoin-chain-mock = { workspace = true } diff --git a/rpc/server/src/module/chain_rpc.rs b/rpc/server/src/module/chain_rpc.rs index 5257c7fe14..34175dea2c 100644 --- a/rpc/server/src/module/chain_rpc.rs +++ b/rpc/server/src/module/chain_rpc.rs @@ -21,13 +21,13 @@ use starcoin_rpc_api::types::{ TransactionInfoWithProofView, TransactionView, }; use starcoin_rpc_api::FutureResult; -use starcoin_vm_types::StateView; use starcoin_statedb::ChainStateDB; use starcoin_storage::Storage; use starcoin_types::access_path::AccessPath; use starcoin_types::block::BlockNumber; use starcoin_types::filter::Filter; use starcoin_types::startup_info::ChainInfo; +use starcoin_vm_types::StateView; use std::convert::TryInto; use std::sync::Arc; diff --git a/rpc/server/src/module/contract_rpc.rs b/rpc/server/src/module/contract_rpc.rs index aed1db5d3f..92afafeb2b 100644 --- a/rpc/server/src/module/contract_rpc.rs +++ b/rpc/server/src/module/contract_rpc.rs @@ -29,8 +29,8 @@ use starcoin_txpool_api::TxPoolSyncService; use starcoin_types::account_address::AccountAddress; use starcoin_types::language_storage::{ModuleId, StructTag}; use starcoin_types::transaction::{DryRunTransaction, RawUserTransaction, TransactionPayload}; -use starcoin_vm_types::access_path::AccessPath; use starcoin_vm_types::file_format::CompiledModule; +use starcoin_vm_types::state_store::state_key::StateKey; use starcoin_vm_types::state_store::StateView; use starcoin_vm_types::transaction::authenticator::AccountPublicKey; use std::str::FromStr; @@ -86,8 +86,9 @@ where { fn get_code(&self, module_id: StrView) -> FutureResult>>> { let service = self.chain_state.clone(); + let state_key = StateKey::module(module_id.0.address(), module_id.0.name()); let f = async move { - let code = service.get(AccessPath::from(&module_id.0)).await?; + let code = service.get(state_key).await?.map(|v| v.to_vec()); Ok(code.map(StrView)) }; Box::pin(f.map_err(map_err).boxed()) @@ -102,17 +103,16 @@ where let playground = self.playground.clone(); let f = async move { let state_root = service.clone().state_root().await?; - let data = service - .get(AccessPath::resource_access_path( - addr, - resource_type.0.clone(), - )) - .await?; + let state_key = StateKey::resource(&addr, &resource_type.0)?; + let data = service.get(state_key).await?; match data { None => Ok(None), Some(d) => { - let value = - playground.view_resource(state_root, &resource_type.0, d.as_slice())?; + let value = playground.view_resource( + state_root, + &resource_type.0, + d.to_vec().as_slice(), + )?; Ok(Some(value.into())) } } diff --git a/rpc/server/src/module/helpers.rs b/rpc/server/src/module/helpers.rs index 58ca03e27b..9455c64d52 100644 --- a/rpc/server/src/module/helpers.rs +++ b/rpc/server/src/module/helpers.rs @@ -64,15 +64,12 @@ where .or_else(|| self.pool.next_sequence_number(sender)) { Some(n) => n, - None => match self + None => self .chain_state .clone() .get_resource::(sender) .await? - { - Some(r) => r.sequence_number(), - None => anyhow::bail!("cannot find account {} onchain", sender), - }, + .sequence_number(), }; let max_gas_amount = txn_request.max_gas_amount.unwrap_or(1000000); // default 10_00000 let max_gas_price = txn_request.gas_unit_price.unwrap_or(1); diff --git a/rpc/server/src/module/state_rpc.rs b/rpc/server/src/module/state_rpc.rs index 2426982c7c..0f8b0154d2 100644 --- a/rpc/server/src/module/state_rpc.rs +++ b/rpc/server/src/module/state_rpc.rs @@ -3,6 +3,7 @@ use crate::module::map_err; use bcs_ext::BCSCodec; +use bytes::Bytes; use futures::future::TryFutureExt; use futures::FutureExt; use starcoin_abi_resolver::ABIResolver; @@ -18,17 +19,16 @@ use starcoin_rpc_api::types::{ TableInfoView, }; use starcoin_rpc_api::FutureResult; -use starcoin_state_api::{ChainStateAsyncService, StateView}; +use starcoin_state_api::ChainStateAsyncService; use starcoin_state_tree::StateNodeStore; use starcoin_statedb::{ChainStateDB, ChainStateReader}; use starcoin_types::language_storage::ModuleId; -use starcoin_types::{ - access_path::AccessPath, account_address::AccountAddress, account_state::AccountState, -}; +use starcoin_types::{account_address::AccountAddress, account_state::AccountState}; use starcoin_vm_types::identifier::Identifier; use starcoin_vm_types::language_storage::{struct_tag_match, StructTag}; use starcoin_vm_types::state_store::state_key::StateKey; use starcoin_vm_types::state_store::table::TableHandle; +use starcoin_vm_types::state_store::TStateView; use std::collections::BTreeMap; use std::sync::Arc; @@ -56,35 +56,35 @@ impl StateApi for StateRpcImpl where S: ChainStateAsyncService, { - fn get(&self, access_path: AccessPath) -> FutureResult>> { - let fut = self.service.clone().get(access_path).map_err(map_err); + fn get(&self, state_key: StateKey) -> FutureResult> { + let fut = self.service.clone().get(state_key).map_err(map_err); Box::pin(fut) } - fn get_state_node_by_node_hash(&self, key_hash: HashValue) -> FutureResult>> { + fn get_state_node_by_node_hash(&self, key_hash: HashValue) -> FutureResult> { let state_store = self.state_store.clone(); let f = async move { let node = state_store.get(&key_hash)?.map(|n| n.0); - Ok(node) + Ok(node.map(|v| Bytes::from(v))) }; Box::pin(f.map_err(map_err).boxed()) } - fn get_with_proof(&self, access_path: AccessPath) -> FutureResult { + fn get_with_proof(&self, state_key: StateKey) -> FutureResult { let fut = self .service .clone() - .get_with_proof(access_path) + .get_with_proof(state_key) .map_ok(|p| p.into()) .map_err(map_err); Box::pin(fut) } - fn get_with_proof_raw(&self, access_path: AccessPath) -> FutureResult>> { + fn get_with_proof_raw(&self, state_key: StateKey) -> FutureResult>> { let fut = self .service .clone() - .get_with_proof(access_path) + .get_with_proof(state_key) .map_ok(|p| { StrView(bcs_ext::to_bytes(&p).expect("Serialize StateWithProof should success.")) }) @@ -92,7 +92,7 @@ where Box::pin(fut) } - fn get_account_state(&self, address: AccountAddress) -> FutureResult> { + fn get_account_state(&self, address: AccountAddress) -> FutureResult { let fut = self .service .clone() @@ -158,13 +158,13 @@ where fn get_with_proof_by_root( &self, - access_path: AccessPath, + state_key: StateKey, state_root: HashValue, ) -> FutureResult { let fut = self .service .clone() - .get_with_proof_by_root(access_path, state_root) + .get_with_proof_by_root(state_key, state_root) .map_ok(|p| p.into()) .map_err(map_err); Box::pin(fut) @@ -172,13 +172,13 @@ where fn get_with_proof_by_root_raw( &self, - access_path: AccessPath, + state_key: StateKey, state_root: HashValue, ) -> FutureResult>> { let fut = self .service .clone() - .get_with_proof_by_root(access_path, state_root) + .get_with_proof_by_root(state_key, state_root) .map_ok(|p| { StrView(bcs_ext::to_bytes(&p).expect("Serialize StateWithProof should success.")) }) @@ -186,12 +186,12 @@ where Box::pin(fut) } - fn get_table_info(&self, address: AccountAddress) -> FutureResult> { + fn get_table_info(&self, address: AccountAddress) -> FutureResult { let fut = self .service .clone() .get_table_info(address) - .map_ok(|v| v.map(Into::into)) + .map_ok(|v| v.into()) .map_err(map_err); Box::pin(fut) } @@ -238,8 +238,8 @@ where .state_root .unwrap_or(service.clone().state_root().await?); let chain_state = ChainStateDB::new(state_store, Some(state_root)); - let code = chain_state - .get_state_value(&StateKey::AccessPath(AccessPath::from(&module_id.0)))?; + let state_key = StateKey::module_id(&module_id.0); + let code = chain_state.get_state_value_bytes(&state_key)?; Ok(match code { None => None, Some(c) => { @@ -250,7 +250,7 @@ where }; Some(CodeView { - code: StrView(c), + code: StrView(c.to_vec()), abi, }) } @@ -273,21 +273,21 @@ where .state_root .unwrap_or(service.clone().state_root().await?); let chain_state = ChainStateDB::new(state_store, Some(state_root)); - let data = chain_state.get_state_value(&StateKey::AccessPath( - AccessPath::resource_access_path(addr, resource_type.0.clone()), - ))?; + let state_key = StateKey::resource(&addr, &resource_type.0)?; + let data = chain_state.get_state_value_bytes(&state_key)?; Ok(match data { None => None, Some(d) => { let decoded = if option.decode { - let value = view_resource(&chain_state, resource_type.0, d.as_slice())?; + let value = + view_resource(&chain_state, resource_type.0, d.to_vec().as_slice())?; Some(value.into()) } else { None }; Some(ResourceView { - raw: StrView(d), + raw: StrView(d.to_vec()), json: decoded, }) } diff --git a/state/api/src/lib.rs b/state/api/src/lib.rs index cd9bf6bb8e..56d873774e 100644 --- a/state/api/src/lib.rs +++ b/state/api/src/lib.rs @@ -43,16 +43,16 @@ pub static TABLE_PATH_LIST: Lazy> = Lazy::new(|| { #[async_trait::async_trait] pub trait ChainStateAsyncService: Clone + std::marker::Unpin + Send + Sync { - async fn get(self, state_key: &StateKey) -> Result>; + async fn get(self, state_key: StateKey) -> Result>; - async fn get_with_proof(self, state_key: &StateKey) -> Result; + async fn get_with_proof(self, state_key: StateKey) -> Result; async fn get_resource(self, address: AccountAddress) -> Result where R: MoveResource, { let rsrc_bytes = self - .get(&StateKey::resource_typed::(&address)?) + .get(StateKey::resource_typed::(&address)?) .await? .ok_or_else(|| { format_err!( @@ -108,8 +108,8 @@ impl ChainStateAsyncService for ServiceRef where S: ActorService + ServiceHandler, { - async fn get(self, state_key: &StateKey) -> Result> { - let response = self.send(StateRequest::Get(state_key.clone())).await??; + async fn get(self, state_key: StateKey) -> Result> { + let response = self.send(StateRequest::Get(state_key)).await??; if let StateResponse::State(state) = response { Ok(state) } else { @@ -117,10 +117,8 @@ where } } - async fn get_with_proof(self, state_key: &StateKey) -> Result { - let response = self - .send(StateRequest::GetWithProof(state_key.clone())) - .await??; + async fn get_with_proof(self, state_key: StateKey) -> Result { + let response = self.send(StateRequest::GetWithProof(state_key)).await??; if let StateResponse::StateWithProof(state) = response { Ok(*state) } else { @@ -171,7 +169,10 @@ where state_root: HashValue, ) -> Result { let response = self - .send(StateRequest::GetWithProofByRoot(state_key, state_root)) + .send(StateRequest::GetWithProofByRoot( + state_key.clone(), + state_root, + )) .await??; if let StateResponse::StateWithProof(state) = response { Ok(*state) diff --git a/state/api/src/mock/mock_chain_state_service.rs b/state/api/src/mock/mock_chain_state_service.rs index 0630811334..b0ad0de09c 100644 --- a/state/api/src/mock/mock_chain_state_service.rs +++ b/state/api/src/mock/mock_chain_state_service.rs @@ -24,11 +24,11 @@ impl MockChainStateService { #[allow(clippy::diverging_sub_expression)] #[async_trait::async_trait] impl ChainStateAsyncService for MockChainStateService { - async fn get(self, _state_key: &StateKey) -> Result> { + async fn get(self, _state_key: StateKey) -> Result> { unimplemented!() } - async fn get_with_proof(self, _state_key: &StateKey) -> Result { + async fn get_with_proof(self, _state_key: StateKey) -> Result { unimplemented!() } diff --git a/vm/types/src/state_store/state_key/inner.rs b/vm/types/src/state_store/state_key/inner.rs index b8f90a93bf..7aac6abc0b 100644 --- a/vm/types/src/state_store/state_key/inner.rs +++ b/vm/types/src/state_store/state_key/inner.rs @@ -4,6 +4,7 @@ use crate::{access_path::AccessPath, state_store::table::TableHandle}; use bytes::{BufMut, Bytes, BytesMut}; use num_derive::{FromPrimitive, ToPrimitive}; +use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use starcoin_crypto::hash::CryptoHasher; use std::{ @@ -43,18 +44,20 @@ pub enum StateKeyDecodeErr { AnyHow(#[from] anyhow::Error), } -#[derive(Clone, CryptoHasher, Eq, PartialEq, Serialize, Deserialize, Ord, PartialOrd, Hash)] +#[derive( + Clone, CryptoHasher, Eq, PartialEq, Serialize, Deserialize, Ord, PartialOrd, Hash, JsonSchema, +)] #[cfg_attr(any(test, feature = "fuzzing"), derive(proptest_derive::Arbitrary))] #[serde(rename = "StateKey")] pub enum StateKeyInner { AccessPath(AccessPath), TableItem { handle: TableHandle, - #[serde(with = "serde_bytes")] + //#[serde(with = "serde_bytes")] key: Vec, }, // Only used for testing - #[serde(with = "serde_bytes")] + // #[serde(with = "serde_bytes")] Raw(Vec), } diff --git a/vm/types/src/state_store/state_key/mod.rs b/vm/types/src/state_store/state_key/mod.rs index 9594e936e5..8b11475607 100644 --- a/vm/types/src/state_store/state_key/mod.rs +++ b/vm/types/src/state_store/state_key/mod.rs @@ -36,6 +36,7 @@ use move_core_types::{ move_resource::MoveResource, }; use num_traits::FromPrimitive; +use schemars::JsonSchema; use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer}; use std::{ cmp::Ordering, @@ -45,7 +46,7 @@ use std::{ sync::Arc, }; -#[derive(Clone)] +#[derive(Clone, JsonSchema)] pub struct StateKey(Arc); impl Debug for StateKey { diff --git a/vm/types/src/state_store/state_key/registry.rs b/vm/types/src/state_store/state_key/registry.rs index ff8675366d..fff1d74f6e 100644 --- a/vm/types/src/state_store/state_key/registry.rs +++ b/vm/types/src/state_store/state_key/registry.rs @@ -18,6 +18,7 @@ use move_core_types::{ language_storage::StructTag, }; use once_cell::sync::Lazy; +use schemars::JsonSchema; use starcoin_crypto::hash::CryptoHasher; use starcoin_crypto::HashValue; use starcoin_infallible::RwLock; @@ -27,7 +28,7 @@ use std::{ sync::{Arc, Weak}, }; -#[derive(Debug)] +#[derive(Debug, JsonSchema)] pub struct Entry { pub deserialized: StateKeyInner, pub encoded: Bytes, diff --git a/vm/vm-runtime/src/natives.rs b/vm/vm-runtime/src/natives.rs index 52bb9c8cc9..93d0f9808d 100644 --- a/vm/vm-runtime/src/natives.rs +++ b/vm/vm-runtime/src/natives.rs @@ -12,6 +12,7 @@ use move_table_extension::{TableHandle, TableResolver}; use move_vm_runtime::native_functions::NativeFunctionTable; use starcoin_gas_schedule::{MiscGasParameters, NativeGasParameters, LATEST_GAS_FEATURE_VERSION}; use starcoin_native_interface::SafeNativeBuilder; +use starcoin_types::delayed_fields::PanicError; use starcoin_vm_types::{ account_config::CORE_CODE_ADDRESS, on_chain_config::{Features, TimedFeatures, TimedFeaturesBuilder}, @@ -39,7 +40,6 @@ impl StarcoinBlankStorage { } } -/* #[cfg(feature = "testing")] impl TAggregatorV1View for StarcoinBlankStorage { type Identifier = StateKey; @@ -50,11 +50,10 @@ impl TAggregatorV1View for StarcoinBlankStorage { ) -> anyhow::Result> { Ok(None) } -} */ +} -/* #[cfg(feature = "testing")] -impl TDelayedFieldView for AptosBlankStorage { +impl TDelayedFieldView for StarcoinBlankStorage { type Identifier = DelayedFieldID; type ResourceGroupTag = StructTag; type ResourceKey = StateKey; @@ -108,7 +107,7 @@ impl TDelayedFieldView for AptosBlankStorage { ) -> Result, PanicError> { unimplemented!() } -} */ +} #[cfg(feature = "testing")] impl TableResolver for StarcoinBlankStorage {