notional-labs / craft

20 stars 59 forks source link

Craft Middleware refactor #114

Closed faddat closed 2 years ago

faddat commented 2 years ago

Hey guys, so there's been a decision upstream that has pretty deep effects on craft.

antehandler -> middleware -> antehandler

So basically we've got to rework craft and the promise of not breaking api's well, it won't be fulfilled. But that's okay, we won't dwell on that part.

In fact, Craft has become all of Notional's chains, will soon become Dig, and we'd like it to kick off a few hundred, or thousand chains.

Here's some relevant context, but it is fair to say that there are affects across the entire cosmos stack.

https://github.com/cosmos/cosmos-sdk/pull/11979

https://github.com/cosmos/cosmos-sdk/issues/11955

Specifcally, the SDK team has decided to revert to the antehandler pattern from middleware.

Here are the pieces of craft that are affected by this decision:

So, that's to say that we're going to need to do significant rework here, I'd like to say that we need to give ourselves at least two weeks to sort that out, and then return to the previous release cadence.

Since Osmosis is sponsoring the use of craft as a template to be included in the sdk, and because I really want to see live integration tests across cosmos like the one that I made for Gaia that state syncs Gaia with numerous databases, I don't want to significantly change our plan or direction.

Cosmos SDK 46 reached v0.46.0-beta2, and had reached a stage where there were not supposed to be further large api breaking changes. We were actually ahead of schedule with craft, and the SDK itself was ahead of schedule, too (well, ahead of my anticipated schedule, anyhow).

Because of the reversion, some stuff will get easier, and other stuff is going to get harder.

I'd like to circle back here, and really focus in on the templating aspect of the work here:

https://github.com/notional-labs/craft/issues/108

Yesterday and the day before and today as well I spent a whole lot of time pulling starport out of Juno.

https://github.com/CosmosContracts/juno/pull/207

So, let's run through our next steps, given all of this new information:

We won't do an sdk 45 version of the base, to limit the scope of the work and lower our future technical debt.

So basically, the way that we'll be able to maintain all this code, and help others to maintain their code, is by separating the parts of developing a cosmos chain into two:

1) base The base will include tendermint, cosmos-sdk, and ibc-go. There will be a cosmwasm flavored base, and a base without cosmwasm.

2) Features First of all it is notable that if all features are in cosmwasm, you spin up a base, make a genesis, and just "go". Juno is a reasonable example of that playing out though I suspect that Juno will retain dominance in unpermissioned and that others will want to be a "flavored base" weather permissioned or not. We can think of osmosis as an app platform that is highly specalized around providing amm pools. It has features written in both cw and go.

Information about downstream consumers has been removed to prevent ambiguity.

faddat commented 2 years ago

Guys work on this is currently blocked here:

https://github.com/cosmos/cosmos-sdk/pull/11985

That PR has been merged.

Unblocked at sdk.

Blocked at ibc-go here:

https://github.com/cosmos/ibc-go/pull/1439 https://github.com/cosmos/ibc-go/pull/1412 https://github.com/cosmos/ibc-go/pull/1413

faddat commented 2 years ago

https://github.com/cosmos/ibc-go/pull/1439

Please reference this PR as a tracker and please retweet this:

https://twitter.com/gadikian/status/1529725454005174272

Reecepbcups commented 2 years ago

@faddat This was completed correct? Want to double check before closing