So I was messing with a wee script to stress DBC transactions. Running on a 30 node testnet it puts the genesis DBC into WALLET01 and then reissues 10SNT and deposits that into WALLET02 1000 times.
But after 511 loops, this happens
Wallet at "safe://hyryynyzj5msffzwgasujkrk6u5ieug7pzdoo867mxzz1pk3cu75ir74mnhb6o" has a total balance of 4525519019.999996430 safecoins
Wallet at "safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o" has a total balance of 5100.000000000 safecoins
[
"safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o",
"dbc-08699f29"
]
Wallet at "safe://hyryynyzj5msffzwgasujkrk6u5ieug7pzdoo867mxzz1pk3cu75ir74mnhb6o" has a total balance of 4525519009.999996423 safecoins
Wallet at "safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o" has a total balance of 5110.000000000 safecoins
Error:
0: ClientError: Cannot add another entry since the register entry cap has been reached: 1024
1: Cannot add another entry since the register entry cap has been reached: 1024
Location:
sn_cli/src/subcommands/wallet.rs:235
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Error:
0: Could not deserialize specified hex string to a DBC: io error: unexpected end of file
Aaaaaand…
total balance of 4525519009.999996423
so how come I’m missing 0.000000007 SNT per Tx? Are we already implementing fees?
Easier to see from the top of the log
Spendable DBC deposited (4525524120.000000000 safecoins) with name 'dbc-83698983' in wallet located at "safe://hyryynyzj5msffzwgasujkrk6u5ieug7pzdoo867mxzz1pk3cu75ir74mnhb6o"
Wallet at "safe://hyryynyzj5msffzwgasujkrk6u5ieug7pzdoo867mxzz1pk3cu75ir74mnhb6o" has a total balance of 4525524120.000000000 safecoins
Wallet at "safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o" has a total balance of 0.000000000 safecoins
-------------------------------------------
[
"safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o",
"dbc-56bffa7f"
]
Wallet at "safe://hyryynyzj5msffzwgasujkrk6u5ieug7pzdoo867mxzz1pk3cu75ir74mnhb6o" has a total balance of 4525524109.999999993 safecoins
Wallet at "safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o" has a total balance of 10.000000000 safecoins
[
"safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o",
"dbc-8b7d2450"
]
Wallet at "safe://hyryynyzj5msffzwgasujkrk6u5ieug7pzdoo867mxzz1pk3cu75ir74mnhb6o" has a total balance of 4525524099.999999986 safecoins
Wallet at "safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o" has a total balance of 20.000000000 safecoins
[
"safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o",
"dbc-13c79c02"
]
Wallet at "safe://hyryynyzj5msffzwgasujkrk6u5ieug7pzdoo867mxzz1pk3cu75ir74mnhb6o" has a total balance of 4525524089.999999979 safecoins
Wallet at "safe://hyryynys9hyj86rsps83xeg3fbny6t3gexcrrsasfmcm9yrg8ehdduuq1rab6o" has a total balance of 30.000000000 safecoins
Are there plans to migrate the wallet to its own data structure that will allow for >1024 entries?
I think we need this fairly soon to allow for proper intensive testing.
The plan for payment-network was to start with a local wallet. I have that implementation going already. And it is designed with storage in network in mind. So the structure and patterns are directly applicable on the network data structure, for when the time for that comes.
And that is, at a first stage, chained registers.
But a couple of years ago now, I made an implementation of a B+tree over the MutableData/AppendOnly structures we had before, and AppendOnly is what became a register. (Ever expanding database, is a search phrase that might turn up something here.)
Anyway, if I dive into that again, then we’re looking at a db fundament, with indexing. Much more scalable than a simple chained register.
Now, I don’t think a wallet couldn’t be satisfactorily designed without a B+tree, especially in early phases. But with that I know you would never need to worry about capacity and keep acceptable access times
Thank you for that and thank you for your efforts in general.
I need to go away and read up on a few things. I was never taught CompSci - nor in fact anything other than BASIC at college so I am a bit lost on B+trees and database theory in general.
I’ll do some reading then look at your answer above and see if I am much wiser then.
Ill start with a search on Ever expanding database