Since returning from Bitcoin++ in Austin, I've been trying to alternate between working on Lightning one week, and Bitcoin hacking on the other.

Mainly, I've been finishing my Script interpreter cpp modification so I can make more comprehensive benchmarks. I've also given in and ordered a raspberry pi 3, 4 and 5 to benchmark.

I hope to answer the key questions on what a realistic budget for large stack objects should be. In particular, there are four reasonable limits on their size (I'm not considering changing the 1000 stack element limit, since that seems roomy!)

1. 520 bytes. We are here now, but as Script gets better that will be very limiting.

2. 520,000 bytes: simply limit the total stack size, not individual entries.

3. 4,000,000 bytes. This allows you to put the largest possible transaction on the stack. But you need a total limit of at least twice this, so you can make a copy: you can't do much in script without doing this!

4. 400,000 bytes. If number 3 is too much of a reach, this means you can put any standard tx on the stack. Again, you want a total limit of at least twice this.

My laptop, with something stupid like 26MB of level 3 cache, and my build machine with 32MB, can handle this fine. But what about the Pi?

I'll find out next week...

Reply to this note

Please Login to reply.

Discussion

Proof that this is the real Rusty:

https://twitter.com/rusty_twit/status/1792865123658510648?t=Kh-kQmsG2VeLGWKwepS4wg&s=19

nostr:note12yjd48hsm7cfltvhr7yla0hcmcvmrrf7vtkr2p6789fflc8xaa9q8kjk9j

you should connect a lightning wallet so you can receive zaps!

Yep 👆

I gotta write some code for that! Hard to do on mobile...

If you wanna dabble in Cashu, you can use `@npub.cash` as your Lightning address and the npub.cash server will mint ecash for you when you receive zaps which you can withdraw whenever you come online.

Why would somebody want to swap Bitcoin for something that has no value?

Do you know what a custodial service is?

Except, Amethyst on Android. No NIP-7, no NIP-46. I guess most people use a web extension? Hmmm, trying nkcli, wish me luck!

Nope, looks like that's a client not a server. Trying 'cargo fillmydisk' on gossip, which seems to be a popular client. Which will probably need an ssh tunnel because, y'know, web...

hack phones/ip address

There’s a bunch of folks doing interesting (sometimes truly bizarre) things in script like implementing MUL with double-and-add or merklized lookup tables, trying to implement a stark verifier, etc. so far we’ve found that the 1000 element stack depth limit is something you need to be aware of, but isn’t *usually* an issue. And i think the places it gets bumped into would be trivially fixed if the stack element limit was raised. Anecdotal, but supports the view that 1000 elements is plenty roomy (*especially* if a stack element was able to be up to 4mb)

Thank you for the nostr-only content 🫡

Do you plan to somehow organize work around GSR and divide work with others?

Yes! Once the basic work is done, there will be plenty of work considering what other things make sense, such as OP_TXHASH or CSFS, and I'm leaving that to others to wrangle...

Thanks! But I am interested how you do "basic work" now. Do you work on it alone? Do you all cooperate on some repo? Some forum?

I sit, I think, I type. Just me so far: it's too in flux for anyone to contribute without getting frustrated that I rewrote it again!

This is all Chinese to me, and I’d love to understand more.

Maybe nostr:npub1njty7prjt49kju6c3mjjlxvm0hjymf5s2qlfcyjqg5e0k8kftp3s4dpsn5 can make easy to understand illustrations of whats going on 👀

Thanks for joining nostr

An increasingly widely used alternative for Bitcoin nodes are the reuse of microform corporate boxes with (typically) an i3/i5, and 8Gb of memory with whatever ssd storage you want to drop in

These are widely available second hand and extremely reliable workhorses that have reached their writedown eol at 3y - Dell and Lenovo would be my picks

They’re superior to Pi’s in part due to processing grunt, but predominantly because storage is not via USB and they have rock solid reliability

Ketan has a solid discussion with Stephan Livera on this last year

I have a spare one I’m happy to ship to you from Brizzy if you’d like to add that into your mix 🤝

Welcome to Nostr nostr:npub179e9tp4yqtqx4myp35283fz64gxuzmr6n3yxnktux5pnd5t03eps0elz4s ⚡️

nostr:note12yjd48hsm7cfltvhr7yla0hcmcvmrrf7vtkr2p6789fflc8xaa9q8kjk9j

Pls tweak it 4 pi 4 & 5 4gb, that will enable decentralization of nodes by empowering people in Africa & Latin america to run their own nodes.

Also how feasible it is 4 max contract size limit.

https://dev.to/mudgen/ethereum-s-maximum-contract-size-limit-is-solved-with-the-diamond-standard-2189

nostr:nevent1qqs9zfx6nmcdlvyl4kt3lz07hmuduxd335lx9mp4qa0rj55lurnw7jspz3mhxue69uhhyetvv9ujuerpd46hxtnfdupzputj2kr2gqkqdtkgrrg50zj942sdc9k848zgd8vhcdgrxmgklrjrqvzqqqqqqyvxxr24

Our current generation of compilers and languages has a really serious limitation with regard to critical code like the Bitcoin Core consensus: you can't ask a compiler to compute the maximum possible stack size used during a function call.

This is easy for compilers to implement because the call graph is known. Obviously, in some cases such as recursive or external calls the answer is infinite, or unknown. But making it possible to compute this in advance would be a significant improvement on the status quo, where you simply have to do testing, and hope it works.