datascript

seepel 2024-07-12T07:13:19.182119Z

I’ve been looking through some of the storage protocol code and I’ve noticed that it seems like addr 1 is used exclusively for the tx-tail of a conn, is that right?

seepel 2024-07-12T07:13:59.475919Z

Just to double check, I’m assuming that if I only use my storage adapter with a db then I will never see anything other than addr 0 for the root, and addrs that correspond to eavt/aevt/avet btrees. My kv store would look like

0 | '{:schema ...}'
10000 | '...eavt'
10001 | '...aevt'
10002 | '...avet'
..... | '.......'
..... | '.......'
..... | '.......'
And if I were to use a conn, it would be structured roughly the same but I would potentially have another entry at addr 1 with a handful of pending (batched) transaction datoms?
0 | '{:schema ...}'
1 | [[[tx1 ...] [tx2 ...]] ...]
10000 | '...eavt'
10001 | '...aevt'
10002 | '...avet'
..... | '.......'
..... | '.......'
..... | '.......'

Niki 2024-07-12T09:07:29.584849Z

Something like that. But pls don’t rely on that, the idea is that we can use any addresses, it’s that just for now we only need 2 of them special

seepel 2024-07-12T18:47:08.484659Z

Thanks, I was testing both and got super confused when I didn’t get the same result.

Niki 2024-07-12T19:04:40.203939Z

yeah storing conn is better since it batches index changes until enough novelty is accumulated and you end up with less writes

1
seepel 2024-07-12T19:04:48.266459Z

> But pls don’t rely on that, the idea is that we can use any addresses, it’s that just for now we only need 2 of them special I’m curious if there are already additional special addrs you have in mind that might be needed?

Niki 2024-07-12T19:05:09.611949Z

not at the moment

Niki 2024-07-12T19:06:04.492119Z

at some point i was thinking of writing batches txs to separate keys

Niki 2024-07-12T19:06:16.313099Z

like 1…999 would be txes

Niki 2024-07-12T19:06:27.574769Z

when it overflows we update indexes

seepel 2024-07-12T19:06:35.596969Z

That is what I thought this was for originally.

Niki 2024-07-12T19:06:55.358109Z

but then decoded to just vector to the index 1 and update it with each tx

Niki 2024-07-12T19:08:59.416939Z

i don’t remember exact reason why I decided to go this way

seepel 2024-07-12T19:12:09.650899Z

It seems to me that if addrs mapped to txs then it would grow unbounded and you wouldn’t be able to keep them in the special addr section?

Niki 2024-07-13T15:35:03.954829Z

Not all txes, just the ones that haven’t been merged to the indexes

Niki 2024-07-13T15:35:14.118859Z

like a buffer

Niki 2024-07-13T15:35:20.239289Z

what tail is currently

seepel 2024-07-13T18:23:17.964159Z

Ah, that makes sense.