godwokenrises / light-godwoken Goto Github PK
View Code? Open in Web Editor NEWA token bridge between CKB(layer 1) and Godwoken(layer 2)
Home Page: https://bridge.godwoken.io
License: MIT License
A token bridge between CKB(layer 1) and Godwoken(layer 2)
Home Page: https://bridge.godwoken.io
License: MIT License
Currently, whenever the current network changes from a supported network to an unsupported network, godwoken-bridge requests to switch the current network to a supported one, which can be too aggressive as it can be triggered even if the user was focusing on other apps.
Maybe when we detect a network change, we should notify and ask the user to switch the network first, instead of requesting the switch directly. An example of the process:
Thanks to @gpBlockchain @Dawn-githup for pointing out the issue.
####Steps to reproduce the behavior:
1.V0 initiates a withdrawal to v1
2.The transaction history will be displayed in both v0WithdrawalHistory and v1DepositHistory
####According to the light-godoken display rule, only one item needs to be displayed
This data is obtained from scan
getDepositHistories:
light-godwoken/packages/light-godwoken/src/LightGodwokenV1.ts
Lines 206 to 208 in ba9ea9d
getWithdrawalHistories
light-godwoken/packages/light-godwoken/src/LightGodwokenV0.ts
Lines 273 to 276 in ba9ea9d
When making a withdrawal to L1 from Godwoken Bridge, the default time is always 7 days. But in practice it is usually longer, around 10 days.
In the Godwoken documentation (https://docs.godwoken.io/gwchangelog/v0difv1) there is a remaining time interval between 8 and 12 days, depending on the status of the network.
Some ideas:
Show as estimated remaining time the minimum possible, 8 days + third proposal.
Show as estimated remaining time the average time between 8 and 12, which would be 10 days + third proposal.
Introduce a textbox that informs the user that the remaining time is variable and not fixed and therefore it can take between 8/12 days. Inside [Pending], for example.
Thank you!
The Godwoken Bridge UI could use some time to do the refactor work, such as refactoring from using StyledComponents to using TailwindCSS. But before this, there are actually tons of UI/CSS frameworks to be selected:
Sorry about mixing them together, I will take some time to look these frameworks out.
Aside with these UI/CSS frameworks, we also have @ricons
that can be used as our SVG icon library.
Also, the version of React can be updated to Vite+React18.
A user has reported a strange issue. He had four request withdrawals with active countdowns, and today one of them, the last one, has disappeared. He can't see it in either YokaiSwap or Godwoken Bridge.
Looking how to reproduce the problem, I have made several test request withdrawals with 400 CKB through https://bridge.godwoken.io/ and they do not appear in pending, but the 400 CKB disappear from the L2 balance. The user has also done it to test it and the same thing happens to him.
For example, this logo url has failed, we might have to look it up:
https://cryptologos.cc/logos/nervos-network-ckb-logo.svg?v=002
I have a user with the following problem:
Made a CKB withdrawal from L2 Godwoken V0 to L1 Nervos using Safepal CKB Bridge. That is, he did not use the YokaiSwap interface to make the withdrawal, but the Safepal interface. That interface, CKB Bridge, no longer exists today. After many attempts, he managed to activate the withdrawal manually but the funds never arrived at L1 and it disappeared from the Safepal withdrawal history, which makes me think that the withdrawal was not really activated and is still blocked (in the TXID it can be seen that the funds are in a middleware address). The user contacted Safepal support but they have not been able to fix it. He has checked if his withdrawal appears on Godwoken Bridge and YokaiSwap, and it does not appear on the interface.
The problem reminds me a lot of that of this other user. The main difference is that he made the withdrawal through YokaiSwap and not from Safepal CKB Bridge.
https://discord.com/channels/657799690070523914/671648403071172619/1022503232498585670
I thought that perhaps we can apply the same solution as to the other user, and he can finally access his funds.
I have sent you a DM via discord @Flouse with the TXID and the addresses of the user to safeguard his privacy, my tag is AlejandroR # 9014 in discord.
Thank you.
Rejected deals will always show up in the Pending list
Steps to reproduce the behavior:
rejected transaction https://explorer.nervos.org/transaction/0x26716127fdd1b923235d1ce6e3ba8e2422118f3b3bfce61e57f09d4068bd4139
Godwoken exposes the config of the mainnet, so we can update the mainnet config. GodwokenExplorer also exposed the mainnet config of Godwoken
'Get 1000 Test Token (TTKN) on L1' Data duplication error occurs after two consecutive operations
Steps to reproduce the behavior:
Error prompt appears
JSONRPCError: server error {"code":-1107,"message":"PoolRejectedDuplicatedTransaction: Transaction(Byte32(0xe233d9171f944bd43e145cf98d45f19e6c03483112a0338323e62632fcc42690)) already exist in transaction_pool","data":"Duplicated(Byte32(0xe233d9171f944bd43e145cf98d45f19e6c03483112a0338323e62632fcc42690))"}
We've found a difference behaviour in LightGodwokenV0 and LightGodwokenV1:
This single difference between v0 and v1 can be erased if we can just request the L2 balance from L2 RPC directly in v0 and v1, instead of requesting from the provider. But there might be other methods with the same issue.
So we need to spend more time reviewing the light-godwoken SDK, and think about how to make the SDK better from a larger perspective. If we could remove all dependencies on the provider (except for signing messages), maybe we don't have to add any network to the provider. This can be the next thing we do.
But on the other hand, if the app does not add a network to the provider, when the user wants to transfer L2 assets to others, do they have to add the network by themselves? It seems like a downside to the feature. @Flouse
One of the apps - https://app.hadouken.finance/ - deployed on Godwoken Mainnet v0 is using dCKB. It would be great if Godwoken Bridge also supported dCKB (both on Testnet and Mainnet).
dCKB erc20 address on testnet v1.1: 0x7e54f7324902B72334827F40f613116F06a88845 (https://nervos.gitbook.io/layer-2-evm/ecosystem/tokens)
The current version of godwoken-bridge can easily trigger a double spend error when constructing an L1 transaction (deposit/l1-transfer/claim-test-sudt). Here's how to reproduce one:
Note that to reproduce the error, the second deposit needs to be sent fast, and then you should receive an error that indicates the transaction was double-spent. More detailed speaking, some inputs
in the second transaction was double-spent.
But why would any cell in the inputs
of a transaction trigger a double-spend error? Let's see how the construction works. When an L1 transaction is constructing, it collects live cells from the sender's address to build outputs
and pay transaction fee
:
Normally when constructing the first transaction, everthing should be fine. But CKB needs time to handle the first transaction, and when you construct the second transaction too fast, while constructing, light-godwoken could collect repeated input cells just like in the first transaction. This is how double-spending works in L1 transactions, you're literally trying to spend the same cell twice.
spent cells
listspent cells
list locally, and exclude those spent cells when collecting input cells. This is an simple idea of how we can do it, in the actual designing/coding phase it could be more difficult to control, as a transaction can be rejected after it is sent.The Confirm
button does not work when the current network is matched to the bridge. How to reproduce:
Godowken Testnet V1
in MetaMaskGodwoken Testnet V1
in MetaMaskConfirm
button in the Network Mismatch dialog, nothing happensdeposit 0.1 COOP transaction:https://explorer.nervos.org/transaction/0xb4f18343befbf7e90aac35d0f8993bf7599f5fa2d59658bd915a405e3cac8ba1
deposit 1 COOP transaction:https://explorer.nervos.org/transaction/0x68adff5ea5c8d34d6deaa9c066548badd5148d2137d9d4f7c58f2ae6e1e501c7
After sending a withdrawal_request, the Withdrawal Pending List
took about 5 minutes to display the new pending withdrawal.
It would be better to show the status of the new pending withdrawal as soon as possible.
We could use gw_get_withdrawal
RPC to get the status of a new withdrawal request.
echo '{
"id": 2,
"jsonrpc": "2.0",
"method": "gw_get_withdrawal",
"params": ["Withdrawal Tx HASH"]
}' \
| tr -d '\n' \
| curl -H 'content-type: application/json' -d @- \
https://godwoken-testnet-v1.ckbapp.dev
Godwoken finality mechanism will be changed by
Some low priority features from the previous season are still on hold, and I think we can finish them before the next release:
The page cannot be closed due to insufficient withdrawal token sent
To Reproduce
Steps to reproduce the behavior:
Expected behavior
error messang: Finalized simple UDT custodian cell is not enough to withdraw
Confirm Request page can be closed
Screenshots or Logs
no error message
The confirmation request page cannot be closed
Error: JSONRPCError: server error {"code":-32007,"message":"Withdrawal fund are still finalizing, please try again later. error: Finalized simple UDT custodian cell is not enough to withdraw"}
Deposit query functions in light-godwoken is not working properly because we're using the old version of @ckb-lumos
. We need to upgrade the version of relevant packages, so then our app can back to normal.
Note that the latest version of the library have breaking changes, check for more details:
Currently a user who uses https://bridge.godwoken.io/ to perform the withdrawal from L2 to L1 has to use YokaiSwap (https://v1.yokaiswap.com/bridge/transfer) or another third-party app to send from L1 Wallet address to a deposit address of a CEX or their Wallet (PortalWallet, Neuron, etc). In my opinion, users should be able to do all the withdrawal steps, including sending to their CEX or wallet or other L1 address from the public architecture and not depend on third parties/apps. It also involves an extra step (change app), which decreases the user experience. I wonder if it is possible to add this functionality to the bridge.
In this way we could avoid this:
Thank you!
1.Initiate multiple transactions in succession
2.Error prompt:Unknown Error, Please try again later
Error: {"code":-301,"message":"TransactionFailedToResolve: Resolve failed Unknown(OutPoint(0x716d254d7cf85b26e83664a0ef89820126e344cfa8b3288855d3bcc10464928a01000000))","data":"Resolve(Unknown(OutPoint(0x716d254d7cf85b26e83664a0ef89820126e344cfa8b3288855d3bcc10464928a01000000)))"}
The testnet_v0
of Godwoken is officially deprecated.
We should keep up with:
Background:
Why:
How:
Application
, find local storage
in left panel:FAQ:
cancel_timeout
will change the deposit lock for the current account, so that the assets deposited to the original deposit lock can't be indexed here. Reset(or remove) the advanced settings to go back to normal mode.####Steps to reproduce the behavior:
Check deposit after a period of time after I initiate multiple deposits_ History
It is found that the completed transaction is still in the Pending list
Ethereum Address: 0xcf5dccb5ceaddaeebf36affd16d5a4bd1ffa5193
Withdrawal Confirmation Request page, the signature page cannot be closed after being pulled down to close
Steps to reproduce the behavior:
Withdrawal Confirmation Request page click X cannot close the page
We use gwscan api to query the user's withdrawal history, and recently I found out that the withdrawal_histories
api that we're using, has a pagination. We should take a look at the details around it.
L1 Transfer Completed list is missing the success identifier
Problem Pr: #224
Steps to reproduce the behavior:
1.See the following figure for details
Right now, light-godwoken (the repo) is a normal repo with two parts of code mixed together:
We think it's time to separate the two parts of code for better management, here's how:
Right now it is difficult for us to know what specific version we are running on godwoken-bridge's testnet/mainnet.
We want to change that, and here we have an example: ForceBridge.
On ForceBridge there is an "About" button that shows the current commit hash for the site, I think we can do it like they do, too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.