hey guys this may be a broad question...
I'm writing a smart contract that recursively builds an svg image given a seed number. the function that draws the image is a view function so it doesn't cost the user any gas, but it recurses a lot so it "costs" A TON of gas for the node executing it (im talking like 100,000,000+ gas) in foundry it works because you can increase the gas limit, but I deployed to sepolia test net and of course it runs out of gas when called from etherscan. do I have any shot at all in getting this to work on a public network? I tried reducing the cost in all the ways I know how to, like basic inline assembly, unchecked{} when doing basic math, rewriting in different ways, etc.
I recall hearing somewhere that the common RPC urls like infura and alchemy allow up to the block gas limit for read functions (which i think is 30,000 for mainnet? so nowhere close). are there any other RPC urls that are either paid or free that allow a higher limit? Or do any layers 2's or sidechains have a higher limit?
My goal is to make this an NFT that raises money for charity. If nothing else works, could I potentially create a node myself, make my own custom RPC url that doesn't have a limit for read functions and then use that for this project? (which I know is technically a centralizing factor). Of course that means it wouldn't work on open sea or any other marketplace, only through a designated front end that i would build.
If i go that route though, couldn't my custom url be attacked? Since there's no gas limit someone could make a function that never stops thus making it useless? Or could I make the url such that it only accepts calls from my specific contract?
so theres a lot of parts to this question, but i hope I explained the gist of it well. if any of it makes sense to you and you have any thoughts I'd love to hear them! if there a gas golfing expert who wants a challenge and/or want to collab on a public goods project shoot me a message!