Content pfp
Content
@
https://warpcast.com/~/channel/ponder-sh
0 reply
0 recast
0 reaction

Kevin pfp
Kevin
@typedarray.eth
This remains unsolved. I think it's impossible - if anyone wants to learn more about traces and double check my work, would gladly chat
3 replies
1 recast
25 reactions

Kevin pfp
Kevin
@typedarray.eth
Created a gist with examples + more context https://gist.github.com/0xOlias/596f21266023bc79adcff3f4d2c113b7 TL;DR - our requirements are weird, but if we solve this it will save Ponder users lots of time and money (on their RPC bill ๐Ÿ™ƒ)
1 reply
0 recast
1 reaction

Mats pfp
Mats
@mats
Just to confirm: you know that postgres can sort (correctly) on array fields such as traceAddress? If I'm not mistaken, that's what we did (when we were on postgres)
1 reply
0 recast
0 reaction

Kevin pfp
Kevin
@typedarray.eth
Oh wow, I did not expect it to work out of the box on the traceAddress format. We'll have to find a way to make this work in SQLite, which (afaict) does not support array column types. New thread to pull on though - thanks!
1 reply
0 recast
1 reaction

Mats pfp
Mats
@mats
Double check that storing as a TEXT and sorting it won't work for you. I think it might produce the same ordering
1 reply
0 recast
0 reaction

Kevin pfp
Kevin
@typedarray.eth
I think that will break if any elements exceed 9, eg these will not order properly: [0,1,9] [0,1,11] Thanks again, have more to play with now!
2 replies
0 recast
1 reaction

will pfp
will
@w
this is a Bad Answer, but maybe it'll spark a good one: iirc EVM has a maximum call-depth of 1024, so can you just add 1024 columns and then order_by ~all of them? most of entries stay blank and most ordering should happen at the early columns so i could imagine a world where it's handled reasonably well by sqlite
2 replies
0 recast
0 reaction

Kevin pfp
Kevin
@typedarray.eth
This was my first idea! And the practical max call depth is ~400 after EIP150. The real challenge is that there's no practical limit to the # of sibling calls.
1 reply
0 recast
1 reaction

will pfp
will
@w
wait why does that matter? the sibling calls are differentiated by an int (or w/e you use in sqlite for bigints) which surely has enough headroom for sibling calls? what am i missing?
1 reply
0 recast
0 reaction

Kevin pfp
Kevin
@typedarray.eth
Ah, yes it's fine if each depth gets a column. But, call patterns like this A CALL B ... 400 more CALLs deep CALL C CALL D ... 10000 more CALLs wide CALL Z make it difficult to do anything more compact, eg allocating 3 digits in an int to each depth.
1 reply
0 recast
0 reaction