policy client: key is too big #54

Closed
opened 2023-11-23 11:36:30 +00:00 by dkirillov · 2 comments
Member

I want the tests pass with the following patch to master

I want to add chain to policy contract with namespace root and unprintable name with length 38 (I expected key length in contract be 1 (prefix) + 2 (length namespace bytes) + 4 (namespace) + 38 (name) = 45)

It seems somewhere between client and neo-go we transform unprintable bytes to several bytes (38 became 60, 66 and some other lengths). If I try use neotest framework everything works as expected

diff --git a/policy/policy_contract.go b/policy/policy_contract.go
index 398468b..f2c8c94 100644
--- a/policy/policy_contract.go
+++ b/policy/policy_contract.go
@@ -3,6 +3,8 @@ package policy
 import (
        "git.frostfs.info/TrueCloudLab/frostfs-contract/common"
        "github.com/nspcc-dev/neo-go/pkg/interop/iterator"
+       "github.com/nspcc-dev/neo-go/pkg/interop/native/std"
+       "github.com/nspcc-dev/neo-go/pkg/interop/runtime"
        "github.com/nspcc-dev/neo-go/pkg/interop/storage"
 )
 
@@ -28,7 +30,8 @@ func storageKey(prefix Kind, entityName, name string) []byte {
 }
 
 func AddChain(entity Kind, entityName, name string, chain []byte) {
-       common.CheckAlphabetWitness() // TODO: Allow to work with chain directly for everyone?
+       runtime.Log(std.Itoa10(len(entityName)))
+       runtime.Log(std.Itoa10(len(name)))
 
        ctx := storage.GetContext()
        key := storageKey(entity, entityName, name)
diff --git a/tests/policy_test.go b/tests/policy_test.go
index d484d5a..b066317 100644
--- a/tests/policy_test.go
+++ b/tests/policy_test.go
@@ -2,14 +2,24 @@ package tests
 
 import (
        "bytes"
+       "context"
+       "crypto/md5"
+       "fmt"
+       "math/big"
        "path"
        "testing"
 
        "git.frostfs.info/TrueCloudLab/frostfs-contract/policy"
+       policycontract "git.frostfs.info/TrueCloudLab/frostfs-contract/policy"
+       policyclient "git.frostfs.info/TrueCloudLab/frostfs-contract/rpcclient/policy"
+       "github.com/nspcc-dev/neo-go/pkg/crypto/keys"
        "github.com/nspcc-dev/neo-go/pkg/neotest"
+       "github.com/nspcc-dev/neo-go/pkg/rpcclient"
+       "github.com/nspcc-dev/neo-go/pkg/rpcclient/actor"
        "github.com/nspcc-dev/neo-go/pkg/util"
        "github.com/nspcc-dev/neo-go/pkg/vm"
        "github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
+       "github.com/nspcc-dev/neo-go/pkg/wallet"
        "github.com/stretchr/testify/require"
 )
 
@@ -28,6 +38,48 @@ func newPolicyInvoker(t *testing.T) *neotest.ContractInvoker {
        return e.CommitteeInvoker(h)
 }
 
+func TestBigKey(t *testing.T) {
+       e := newPolicyInvoker(t)
+
+       acc, err := wallet.NewAccount()
+       require.NoError(t, err)
+
+       wlt := initTmpWallet(t)
+       ctx, cancel := context.WithCancel(context.Background())
+       defer cancel()
+       address := runRPC(ctx, t, e.Chain, wlt)
+
+       rpcCli, err := rpcclient.New(context.Background(), "http://"+address, rpcclient.Options{})
+       require.NoError(t, err)
+
+       act, err := actor.NewSimple(rpcCli, acc)
+       require.NoError(t, err)
+
+       cli := policyclient.New(act, e.Hash)
+
+       a := awaiter{
+               ctx: ctx,
+               t:   t,
+               rpc: rpcCli,
+       }
+
+       p1 := []byte("chain1")
+       key, err := keys.NewPrivateKey()
+       require.NoError(t, err)
+
+       hash := md5.New()
+       hash.Write([]byte("policy"))
+       suffix := hash.Sum(nil)
+
+       ns := "root"
+       fmt.Println(len(ns))
+       name := "i" + string(key.PublicKey().GetScriptHash().BytesBE()) + "/" + string(suffix)
+       fmt.Println(len(name))
+
+       a.await(cli.AddChain(big.NewInt(policycontract.IAM), ns, name, p1))
+
+}
+


test output:

=== RUN   TestBigKey
    logger.go:130: 2023-11-23T14:38:06.107+0300	INFO	initial gas supply is not set or wrong, setting default value	{"InitialGASSupply": "52000000"}
    logger.go:130: 2023-11-23T14:38:06.107+0300	INFO	mempool size is not set or wrong, setting default value	{"MemPoolSize": 50000}
    logger.go:130: 2023-11-23T14:38:06.107+0300	INFO	MaxBlockSize is not set or wrong, setting default value	{"MaxBlockSize": 262144}
    logger.go:130: 2023-11-23T14:38:06.107+0300	INFO	MaxBlockSystemFee is not set or wrong, setting default value	{"MaxBlockSystemFee": 900000000000}
    logger.go:130: 2023-11-23T14:38:06.107+0300	INFO	MaxTransactionsPerBlock is not set or wrong, using default value	{"MaxTransactionsPerBlock": 512}
    logger.go:130: 2023-11-23T14:38:06.107+0300	INFO	MaxValidUntilBlockIncrement is not set or wrong, using default value	{"MaxValidUntilBlockIncrement": 86400}
    logger.go:130: 2023-11-23T14:38:06.107+0300	INFO	NativeActivations are not set, using default values
    logger.go:130: 2023-11-23T14:38:06.107+0300	INFO	Hardforks are not set, using default value
    logger.go:130: 2023-11-23T14:38:06.110+0300	INFO	no storage version found! creating genesis block
    logger.go:130: 2023-11-23T14:38:06.177+0300	DEBUG	done processing headers	{"headerIndex": 1, "blockHeight": 0, "took": "176.272µs"}
{"level":"info","msg":"ExtensiblePoolSize is not set or wrong, using default value","ExtensiblePoolSize":20}
{"level":"info","msg":"bad MaxPeers configured, using the default value","configured":0,"actual":100}
{"level":"info","msg":"bad AttemptConnPeers configured, using the default value","configured":0,"actual":20}
{"level":"info","msg":"MaxFindResultItems is not set or wrong, setting default value","MaxFindResultItems":100}
{"level":"info","msg":"MaxFindStorageResultItems is not set or wrong, setting default value","MaxFindStorageResultItems":50}
{"level":"info","msg":"MaxNEP11Tokens is not set or wrong, setting default value","MaxNEP11Tokens":100}
{"level":"info","msg":"MaxWebSocketClients is not set or wrong, setting default value","MaxWebSocketClients":64}
{"level":"info","msg":"node started","blockHeight":1,"headerHeight":1}
{"level":"info","msg":"node reached synchronized state, starting services"}
{"level":"info","msg":"starting state validation service"}
{"level":"info","msg":"starting consensus service"}
{"level":"info","msg":"initializing dbft","height":2,"view":0,"index":0,"role":"Primary"}
{"level":"debug","msg":"reset timer","h":2,"v":0,"delay":"100ms"}
{"level":"debug","msg":"broadcasting message","type":"PrepareRequest","height":2,"view":0}
{"level":"info","msg":"sending PrepareRequest","height":2,"view":0}
{"level":"debug","msg":"reset timer","h":2,"v":0,"delay":"100ms"}
{"level":"debug","msg":"check preparations","hasReq":true,"count":1,"M":1}
{"level":"info","msg":"sending Commit","height":2,"view":0}
{"level":"debug","msg":"broadcasting message","type":"Commit","height":2,"view":0}
{"level":"debug","msg":"reset timer","h":2,"v":0,"delay":"100ms"}
{"level":"info","msg":"approving block","height":2,"hash":"6381136c686cbae57534aec235f899ea26566297ff93d1505b56b919cc0633be","tx_count":0,"merkle":"0000000000000000000000000000000000000000000000000000000000000000","prev":"6bb78eb4443c8eef89759f7710ec0f183d4e4f287631ab1ba7298cba402750cf"}
{"level":"info","msg":"starting rpc-server","endpoint":"localhost:0"}
    logger.go:130: 2023-11-23T14:38:06.596+0300	DEBUG	done processing headers	{"headerIndex": 2, "blockHeight": 1, "took": "189.106µs"}
{"level":"debug","msg":"new block in the chain","dbft index":2,"chain index":2}
{"level":"info","msg":"initializing dbft","height":3,"view":0,"index":0,"role":"Primary"}
{"level":"debug","msg":"reset timer","h":3,"v":0,"delay":"98.902665ms"}
    util.go:221: RPC server is listening at 127.0.0.1:46789, checking health
{"level":"info","msg":"Error encountered with rpc request","code":-32602,"cause":"invalid method 'GET', please retry with 'POST'","method":"","params":"[]"}
{"level":"debug","msg":"timer fired","height":3,"view":0}
{"level":"debug","msg":"timeout","height":3,"view":0}
{"level":"debug","msg":"broadcasting message","type":"PrepareRequest","height":3,"view":0}
{"level":"info","msg":"sending PrepareRequest","height":3,"view":0}
{"level":"debug","msg":"reset timer","h":3,"v":0,"delay":"100ms"}
{"level":"debug","msg":"check preparations","hasReq":true,"count":1,"M":1}
{"level":"info","msg":"sending Commit","height":3,"view":0}
{"level":"debug","msg":"broadcasting message","type":"Commit","height":3,"view":0}
{"level":"debug","msg":"reset timer","h":3,"v":0,"delay":"100ms"}
{"level":"info","msg":"approving block","height":3,"hash":"0034a3254b33fa84fac4619f779a239f7ac886d8b7fba6d394db2d8d025f5ef2","tx_count":0,"merkle":"0000000000000000000000000000000000000000000000000000000000000000","prev":"6381136c686cbae57534aec235f899ea26566297ff93d1505b56b919cc0633be"}
{"level":"debug","msg":"processing rpc request","method":"getversion","params":"[]"}
    logger.go:130: 2023-11-23T14:38:06.696+0300	DEBUG	done processing headers	{"headerIndex": 3, "blockHeight": 2, "took": "106.791µs"}
{"level":"debug","msg":"new block in the chain","dbft index":3,"chain index":3}
{"level":"info","msg":"initializing dbft","height":4,"view":0,"index":0,"role":"Primary"}
{"level":"debug","msg":"reset timer","h":4,"v":0,"delay":"99.667153ms"}
4
38
{"level":"debug","msg":"processing rpc request","method":"invokefunction","params":"[ca3d1d58d8b9f61da1500b2e416bb114b5fe4374 addChain  ]"}
    logger.go:130: 2023-11-23T14:38:06.697+0300	INFO	runtime log	{"tx": "de22aea3da305ec2f52f2e2c16f39d8ef961a4f711380584c1376fceb5f3bc0a", "script": "ca3d1d58d8b9f61da1500b2e416bb114b5fe4374", "msg": "4"}
    logger.go:130: 2023-11-23T14:38:06.697+0300	INFO	runtime log	{"tx": "de22aea3da305ec2f52f2e2c16f39d8ef961a4f711380584c1376fceb5f3bc0a", "script": "ca3d1d58d8b9f61da1500b2e416bb114b5fe4374", "msg": "60"}
{"level":"debug","msg":"processing rpc request","method":"getblockcount","params":"[]"}
{"level":"debug","msg":"processing rpc request","method":"calculatenetworkfee","params":"[AAKfhBFMqHQAAAAAAAAAAAAAAAAABgAAAAGro4Padf8t06CliR+zqOlg9fT32AEAdgwGY2hhaW4xDDxp77+9I0JtKTTGou+/vR8aLTvvv73NhVJm77+9ci/vv73vv73vv71X77+9V2wADO+/vRBbJWDvv73vv70MBHJvb3QAaRTAHwwIYWRkQ2hhaW4MFHRD/rUUsWtBLgtQoR32udhYHT3KQWJ9W1IBACgMIQK/5/e/22kcwn9EkybSpiOrzfF4tN7/Rw0gW3UnSRXFL0FW57Mn]"}
    util.go:37: 
        	Error Trace:	/home/denis/github/tcl/neofs-contract/tests/util.go:37
        	            				/home/denis/github/tcl/neofs-contract/tests/policy_test.go:79
        	Error:      	Received unexpected error:
        	            	script failed (FAULT state) due to an error: at instruction 268 (SYSCALL): System.Storage.Put failed: key is too big
        	Test:       	TestBigKey
{"level":"info","msg":"shutting down server","peers":0}
{"level":"info","msg":"stopping state validation service"}
{"level":"info","msg":"stopping consensus service"}
{"level":"info","msg":"shutting down RPC server","endpoint":"127.0.0.1:46789"}
    logger.go:130: 2023-11-23T14:38:06.698+0300	INFO	persisted to disk	{"blocks": 3, "keys": 170, "headerHeight": 3, "blockHeight": 3, "took": "68.428µs"}
--- FAIL: TestBigKey (0.59s)

FAIL

Process finished with the exit code 1


I want the tests pass with the following patch to [master](https://git.frostfs.info/TrueCloudLab/frostfs-contract/commit/20f86e96b27c3e42677ed6cc06cac3152f86a98f) I want to add chain to `policy` contract with namespace `root` and unprintable name with length `38` (I expected key length in contract be `1 (prefix) + 2 (length namespace bytes) + 4 (namespace) + 38 (name) = 45`) It seems somewhere between client and neo-go we transform unprintable bytes to several bytes (38 became 60, 66 and some other lengths). If I try use neotest framework everything works as expected ```diff diff --git a/policy/policy_contract.go b/policy/policy_contract.go index 398468b..f2c8c94 100644 --- a/policy/policy_contract.go +++ b/policy/policy_contract.go @@ -3,6 +3,8 @@ package policy import ( "git.frostfs.info/TrueCloudLab/frostfs-contract/common" "github.com/nspcc-dev/neo-go/pkg/interop/iterator" + "github.com/nspcc-dev/neo-go/pkg/interop/native/std" + "github.com/nspcc-dev/neo-go/pkg/interop/runtime" "github.com/nspcc-dev/neo-go/pkg/interop/storage" ) @@ -28,7 +30,8 @@ func storageKey(prefix Kind, entityName, name string) []byte { } func AddChain(entity Kind, entityName, name string, chain []byte) { - common.CheckAlphabetWitness() // TODO: Allow to work with chain directly for everyone? + runtime.Log(std.Itoa10(len(entityName))) + runtime.Log(std.Itoa10(len(name))) ctx := storage.GetContext() key := storageKey(entity, entityName, name) diff --git a/tests/policy_test.go b/tests/policy_test.go index d484d5a..b066317 100644 --- a/tests/policy_test.go +++ b/tests/policy_test.go @@ -2,14 +2,24 @@ package tests import ( "bytes" + "context" + "crypto/md5" + "fmt" + "math/big" "path" "testing" "git.frostfs.info/TrueCloudLab/frostfs-contract/policy" + policycontract "git.frostfs.info/TrueCloudLab/frostfs-contract/policy" + policyclient "git.frostfs.info/TrueCloudLab/frostfs-contract/rpcclient/policy" + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/neotest" + "github.com/nspcc-dev/neo-go/pkg/rpcclient" + "github.com/nspcc-dev/neo-go/pkg/rpcclient/actor" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/vm" "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" + "github.com/nspcc-dev/neo-go/pkg/wallet" "github.com/stretchr/testify/require" ) @@ -28,6 +38,48 @@ func newPolicyInvoker(t *testing.T) *neotest.ContractInvoker { return e.CommitteeInvoker(h) } +func TestBigKey(t *testing.T) { + e := newPolicyInvoker(t) + + acc, err := wallet.NewAccount() + require.NoError(t, err) + + wlt := initTmpWallet(t) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + address := runRPC(ctx, t, e.Chain, wlt) + + rpcCli, err := rpcclient.New(context.Background(), "http://"+address, rpcclient.Options{}) + require.NoError(t, err) + + act, err := actor.NewSimple(rpcCli, acc) + require.NoError(t, err) + + cli := policyclient.New(act, e.Hash) + + a := awaiter{ + ctx: ctx, + t: t, + rpc: rpcCli, + } + + p1 := []byte("chain1") + key, err := keys.NewPrivateKey() + require.NoError(t, err) + + hash := md5.New() + hash.Write([]byte("policy")) + suffix := hash.Sum(nil) + + ns := "root" + fmt.Println(len(ns)) + name := "i" + string(key.PublicKey().GetScriptHash().BytesBE()) + "/" + string(suffix) + fmt.Println(len(name)) + + a.await(cli.AddChain(big.NewInt(policycontract.IAM), ns, name, p1)) + +} + ``` test output: ``` === RUN TestBigKey logger.go:130: 2023-11-23T14:38:06.107+0300 INFO initial gas supply is not set or wrong, setting default value {"InitialGASSupply": "52000000"} logger.go:130: 2023-11-23T14:38:06.107+0300 INFO mempool size is not set or wrong, setting default value {"MemPoolSize": 50000} logger.go:130: 2023-11-23T14:38:06.107+0300 INFO MaxBlockSize is not set or wrong, setting default value {"MaxBlockSize": 262144} logger.go:130: 2023-11-23T14:38:06.107+0300 INFO MaxBlockSystemFee is not set or wrong, setting default value {"MaxBlockSystemFee": 900000000000} logger.go:130: 2023-11-23T14:38:06.107+0300 INFO MaxTransactionsPerBlock is not set or wrong, using default value {"MaxTransactionsPerBlock": 512} logger.go:130: 2023-11-23T14:38:06.107+0300 INFO MaxValidUntilBlockIncrement is not set or wrong, using default value {"MaxValidUntilBlockIncrement": 86400} logger.go:130: 2023-11-23T14:38:06.107+0300 INFO NativeActivations are not set, using default values logger.go:130: 2023-11-23T14:38:06.107+0300 INFO Hardforks are not set, using default value logger.go:130: 2023-11-23T14:38:06.110+0300 INFO no storage version found! creating genesis block logger.go:130: 2023-11-23T14:38:06.177+0300 DEBUG done processing headers {"headerIndex": 1, "blockHeight": 0, "took": "176.272µs"} {"level":"info","msg":"ExtensiblePoolSize is not set or wrong, using default value","ExtensiblePoolSize":20} {"level":"info","msg":"bad MaxPeers configured, using the default value","configured":0,"actual":100} {"level":"info","msg":"bad AttemptConnPeers configured, using the default value","configured":0,"actual":20} {"level":"info","msg":"MaxFindResultItems is not set or wrong, setting default value","MaxFindResultItems":100} {"level":"info","msg":"MaxFindStorageResultItems is not set or wrong, setting default value","MaxFindStorageResultItems":50} {"level":"info","msg":"MaxNEP11Tokens is not set or wrong, setting default value","MaxNEP11Tokens":100} {"level":"info","msg":"MaxWebSocketClients is not set or wrong, setting default value","MaxWebSocketClients":64} {"level":"info","msg":"node started","blockHeight":1,"headerHeight":1} {"level":"info","msg":"node reached synchronized state, starting services"} {"level":"info","msg":"starting state validation service"} {"level":"info","msg":"starting consensus service"} {"level":"info","msg":"initializing dbft","height":2,"view":0,"index":0,"role":"Primary"} {"level":"debug","msg":"reset timer","h":2,"v":0,"delay":"100ms"} {"level":"debug","msg":"broadcasting message","type":"PrepareRequest","height":2,"view":0} {"level":"info","msg":"sending PrepareRequest","height":2,"view":0} {"level":"debug","msg":"reset timer","h":2,"v":0,"delay":"100ms"} {"level":"debug","msg":"check preparations","hasReq":true,"count":1,"M":1} {"level":"info","msg":"sending Commit","height":2,"view":0} {"level":"debug","msg":"broadcasting message","type":"Commit","height":2,"view":0} {"level":"debug","msg":"reset timer","h":2,"v":0,"delay":"100ms"} {"level":"info","msg":"approving block","height":2,"hash":"6381136c686cbae57534aec235f899ea26566297ff93d1505b56b919cc0633be","tx_count":0,"merkle":"0000000000000000000000000000000000000000000000000000000000000000","prev":"6bb78eb4443c8eef89759f7710ec0f183d4e4f287631ab1ba7298cba402750cf"} {"level":"info","msg":"starting rpc-server","endpoint":"localhost:0"} logger.go:130: 2023-11-23T14:38:06.596+0300 DEBUG done processing headers {"headerIndex": 2, "blockHeight": 1, "took": "189.106µs"} {"level":"debug","msg":"new block in the chain","dbft index":2,"chain index":2} {"level":"info","msg":"initializing dbft","height":3,"view":0,"index":0,"role":"Primary"} {"level":"debug","msg":"reset timer","h":3,"v":0,"delay":"98.902665ms"} util.go:221: RPC server is listening at 127.0.0.1:46789, checking health {"level":"info","msg":"Error encountered with rpc request","code":-32602,"cause":"invalid method 'GET', please retry with 'POST'","method":"","params":"[]"} {"level":"debug","msg":"timer fired","height":3,"view":0} {"level":"debug","msg":"timeout","height":3,"view":0} {"level":"debug","msg":"broadcasting message","type":"PrepareRequest","height":3,"view":0} {"level":"info","msg":"sending PrepareRequest","height":3,"view":0} {"level":"debug","msg":"reset timer","h":3,"v":0,"delay":"100ms"} {"level":"debug","msg":"check preparations","hasReq":true,"count":1,"M":1} {"level":"info","msg":"sending Commit","height":3,"view":0} {"level":"debug","msg":"broadcasting message","type":"Commit","height":3,"view":0} {"level":"debug","msg":"reset timer","h":3,"v":0,"delay":"100ms"} {"level":"info","msg":"approving block","height":3,"hash":"0034a3254b33fa84fac4619f779a239f7ac886d8b7fba6d394db2d8d025f5ef2","tx_count":0,"merkle":"0000000000000000000000000000000000000000000000000000000000000000","prev":"6381136c686cbae57534aec235f899ea26566297ff93d1505b56b919cc0633be"} {"level":"debug","msg":"processing rpc request","method":"getversion","params":"[]"} logger.go:130: 2023-11-23T14:38:06.696+0300 DEBUG done processing headers {"headerIndex": 3, "blockHeight": 2, "took": "106.791µs"} {"level":"debug","msg":"new block in the chain","dbft index":3,"chain index":3} {"level":"info","msg":"initializing dbft","height":4,"view":0,"index":0,"role":"Primary"} {"level":"debug","msg":"reset timer","h":4,"v":0,"delay":"99.667153ms"} 4 38 {"level":"debug","msg":"processing rpc request","method":"invokefunction","params":"[ca3d1d58d8b9f61da1500b2e416bb114b5fe4374 addChain ]"} logger.go:130: 2023-11-23T14:38:06.697+0300 INFO runtime log {"tx": "de22aea3da305ec2f52f2e2c16f39d8ef961a4f711380584c1376fceb5f3bc0a", "script": "ca3d1d58d8b9f61da1500b2e416bb114b5fe4374", "msg": "4"} logger.go:130: 2023-11-23T14:38:06.697+0300 INFO runtime log {"tx": "de22aea3da305ec2f52f2e2c16f39d8ef961a4f711380584c1376fceb5f3bc0a", "script": "ca3d1d58d8b9f61da1500b2e416bb114b5fe4374", "msg": "60"} {"level":"debug","msg":"processing rpc request","method":"getblockcount","params":"[]"} {"level":"debug","msg":"processing rpc request","method":"calculatenetworkfee","params":"[AAKfhBFMqHQAAAAAAAAAAAAAAAAABgAAAAGro4Padf8t06CliR+zqOlg9fT32AEAdgwGY2hhaW4xDDxp77+9I0JtKTTGou+/vR8aLTvvv73NhVJm77+9ci/vv73vv73vv71X77+9V2wADO+/vRBbJWDvv73vv70MBHJvb3QAaRTAHwwIYWRkQ2hhaW4MFHRD/rUUsWtBLgtQoR32udhYHT3KQWJ9W1IBACgMIQK/5/e/22kcwn9EkybSpiOrzfF4tN7/Rw0gW3UnSRXFL0FW57Mn]"} util.go:37: Error Trace: /home/denis/github/tcl/neofs-contract/tests/util.go:37 /home/denis/github/tcl/neofs-contract/tests/policy_test.go:79 Error: Received unexpected error: script failed (FAULT state) due to an error: at instruction 268 (SYSCALL): System.Storage.Put failed: key is too big Test: TestBigKey {"level":"info","msg":"shutting down server","peers":0} {"level":"info","msg":"stopping state validation service"} {"level":"info","msg":"stopping consensus service"} {"level":"info","msg":"shutting down RPC server","endpoint":"127.0.0.1:46789"} logger.go:130: 2023-11-23T14:38:06.698+0300 INFO persisted to disk {"blocks": 3, "keys": 170, "headerHeight": 3, "blockHeight": 3, "took": "68.428µs"} --- FAIL: TestBigKey (0.59s) FAIL Process finished with the exit code 1 ```
dkirillov added the
bug
label 2023-11-23 11:36:30 +00:00
dkirillov changed title from policy client: keys too big to policy client: key is too big 2023-11-23 11:38:23 +00:00
Owner

The problem most likely is non-UTF8 json marshaling/unmarshaling (used for RPC)
Let's change everything to bytes then, though it would be nice to have user friendly ID here. Is it possible, or do we hit a key limit?

The problem most likely is non-UTF8 json marshaling/unmarshaling (used for RPC) Let's change everything to bytes then, though it would be nice to have user friendly ID here. Is it possible, or do we hit a key limit?
Author
Member

Is it possible, or do we hit a key limit?

Yes, we hit key limit since we need the key to consist of namespace, user key derivations and policy name

> Is it possible, or do we hit a key limit? Yes, we hit key limit since we need the key to consist of namespace, user key derivations and policy name
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-contract#54
No description provided.