Closed samlaf closed 8 months ago
I really don't like that our bn254 and bls methods all take pointer receivers and arguments, eg:
func (p *G2Point) Add(p2 *G2Point)
I've been bitten a few times by side effects while writing the bls aggregation service. I think we just followed the gnark-crypto library design. I raised an issue in their repo asking for the rationale behind this design choice. In the meantime, I think we might want to switch to non pointer receivers and args. A few stack copies is not worth optimizing for, especially if it can save a bunch of human debugging time.
EDIT: I'm stupid, you're smart. I was wrong, you are right. Actually I now don't like our interface for a different set of reasons, listed in that issue. Feels like we should just use the underlying bn254 methods directly (that take receiver and 2 pointer arguments)!
We originally took much of the crypto/bls module from eigenDA, so it currently contains code for both bls and some incredible-squaring specific code.
We need to refactor it and take out all the incredible-squaring code and put that in its own repo.