celo-org / developer-tooling

🛠️ SDKs and CLI for interacting with Celo
Apache License 2.0
10 stars 6 forks source link

make pr on ledger live for celo contractkit upgrade #328

Open aaronmgdr opened 2 months ago

aaronmgdr commented 2 months ago

submit pr on ledger live to upgrade contractkit from 3.0 to 8.0 (and other celo packages that need it) so they work

https://github.com/LedgerHQ/ledger-live/issues/7551

aaronmgdr commented 1 month ago

sent message on discord to ledger team

Letter to Ledger Live TeamHey Etienne, thanks for responding on the developers channel to my request to connect. and for putting me in touch with Akram

The short message is that ledger-live uses an old version of @celo/contractkit and needs to move away from that version to continue working.

Why?

Some history: When celo launched as an alt L1 it used a custom transaction type that like eth legacy was a type 0 but with extra parameters. we call this celo-legacy type. While the celo chain now supports eth-legacy, type 2 and celo’s specific cip64 (gas token) transactions, @celo/contractkit@3.0 only supports celo-legacy transactions.

But celo-legacy transactions are deprecated and the next hardfork will completely remove support for them. Furthermore because the chain will remove support, the latest celo-ledger-spender apponly supports cip64 and eip1559 transactions making it already incompatible with ledger live. An unfortunate situation we were not aware of until recently.

When is the hardfork?

Uncertain for celo mainnet (2 months) but the alfajores testnet is moving to L2 status by end of September.

Wait What is the Hardfork?

I say hardfork but is bigger than that as CELO is becoming an OP based Layer 2.This is why the transaction type is being removed. It is not being backported to the new stack.

Status

To help out I tried upgrading myselfhowever because in jsdom Buffer is not a subclass of Uint8Array,deep in the dependency tree of web3 and noble hash an exception is thrown. Possiblly this could be handled thru configuring jsdom differently but it seems to me like that is a call a maintainer would want to make.

Alternatively I gave it a try to just completely remove contractkit dependency. instead using just ethers plus porting over some logic for interacting with the celo election contract https://github.com/aaronmgdr/ledger-live/pull/1

Im a bit nervous about it as from what i can tell the test situation is not solid for that part of the code.

My ask is can i hand this off to your team to choose the best approach and get it in or work closely with us to do so?

-- Aaron DevTooling Lead at cLabs