Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: prepare for v0.0.4 #222

Merged
merged 26 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
81e3818
tree: introduce lazy init wrapper
MatusKysel Sep 14, 2022
643bf9f
chore: LRU cache with init functions
MatusKysel Sep 16, 2022
5e905c2
tree: improve commit and rollback for asset trees
MatusKysel Sep 20, 2022
f9a605e
Merge branch 'develop' into tree-lazy-init
MatusKysel Sep 20, 2022
b393c21
tree: cache small improvements
MatusKysel Sep 21, 2022
0512614
tree: performance improvements for asset tree cache based on review
MatusKysel Sep 21, 2022
390f9f6
tree: move cache size to config and small improvment
MatusKysel Sep 23, 2022
86cb183
Merge branch 'develop' into tree-lazy-init
MatusKysel Sep 26, 2022
7c1737a
Merge pull request #186 from MatusKysel/tree-lazy-init
MatusKysel Sep 27, 2022
1770831
refactor: prune amm related txs and types (#205)
yutianwu Sep 29, 2022
c58af93
feat(api.server): add `Size` member to `Block struct` for fullnode (#…
cosinlink Sep 29, 2022
c840eef
feat: add icon url for assets (#210)
forcodedancing Sep 29, 2022
885f6f9
committer: add priority operation metric and check the logic of reque…
carlcarl Sep 30, 2022
456637a
fix deploy local script (#208)
keefel Sep 30, 2022
b063c9b
update zkbnb-crypto version (#212)
keefel Sep 30, 2022
43535ae
feat: Replace apiserver gocache with ristretto cache (#207)
carlcarl Oct 4, 2022
c5a5f53
refactor: prohibit native l1 nft deposits (#213)
yutianwu Oct 8, 2022
18c0aad
fix bug when there are mintNft/registerAccount and other txs which us…
lightning-li Oct 10, 2022
a636b56
feat: add totalAssetValue in GetAccount API response (#214)
carlcarl Oct 11, 2022
5050fa5
executor: fix full exit nft (#220)
keefel Oct 12, 2022
af706f4
core: move gas to block level (#206)
forcodedancing Oct 12, 2022
c10d96e
refactor: reduce public inputs of block constraints (#218)
yutianwu Oct 12, 2022
a51fdc2
core, dao: merge new update map for account and nft (#219)
keefel Oct 12, 2022
81f9eac
add golangci-lint install to Makefile (#216)
bnb-tw Oct 12, 2022
8a0cd45
sender: fix corner case in case the rollup tx is timeout (#221)
lightning-li Oct 12, 2022
d23d52d
dep: bump the version of zkbnb-crypto to v0.0.7
unclezoro Oct 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ vendor
deployment/dependency
deployment/configs
deployment/.zkbnb
run_*.sh
run_*.sh

own*
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ tools:
build: api-server build-only

lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.0
golangci-lint run ./...

build-only:
Expand Down
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ ZkBNB achieves the following goals:
cryptographic. Users do not have to trust any third parties or keep monitoring the Rollup blocks in order to
prevent fraud.
- **L1<>L2 Communication**. BNB, and BEP20/BEP721/BEP1155 created on BSC or ZkBNB can flow freely between BSC and ZkBNB.
- **Built-in instant AMM swap**. It allows digital assets to be traded without permission and automatically by using
liquidity pools.
- **Built-in NFT marketplace**. Developer can build marketplace for crypto collectibles and non-fungible tokens (NFTs)
out of box on ZkBNB.
- **Fast transaction speed and faster finality**.
Expand All @@ -35,7 +33,6 @@ ZkBNB starts its development based on [Zecrey](https://github.com/bnb-chain/zecr
- [Key Features](#Key-Features)
+ [Digital Asset Management](#Digital-Asset-Management)
+ [NFT Management and Marketplace](#NFT-Management-and-Marketplace)
+ [AMM Exchange](#AMM-Exchange)
+ [Native Name Service](#Native-Name-Service)
+ [Seamless L1 Wallet Management](#Seamless-L1-Wallet-Management)

Expand All @@ -59,7 +56,7 @@ ZkBNB starts its development based on [Zecrey](https://github.com/bnb-chain/zecr
- **prover**. Prover generates cryptographic proof based on the witness materials.
- **sender**. The sender rollups the compressed l2 blocks to L1, and submit proof to verify it.
- **api server**. The api server is the access endpoints for most users, it provides rich data, including
digital assets, blocks, transactions, swap info, gas fees.
digital assets, blocks, transactions, gas fees.
- **recovery**. A tool to recover the sparse merkle tree in kv-rocks based on the state world in postgresql.


Expand Down Expand Up @@ -105,16 +102,6 @@ being sent to the ZkBNB. Once the offer is matched, an **AtomicMatch** transacti
will be sent to ZkBNB to make the trade happen. Users can also cancel an offer manually by sending a cancel offer
transaction to disable the backend cached offer.

### AMM Exchange

Automated market makers (AMM) are decentralized exchanges that pool liquidity from users and price the assets within
the pool using algorithms.

ZkBNB follows the similar mechanic as [UniSwap V2](https://docs.uniswap.org/protocol/V2/concepts/protocol-overview/how-uniswap-works).
Anyone can become a liquidity provider (LP) for a pool by depositing an equivalent value of each underlying token in
return for pool tokens. The different from UniSwap is that the LP token on ZkBNB can not transfer or trade. Users can
simply list a swap pair by calling the rollup contract on BSC.

### Native Name Service
No more copying and pasting long addresses on ZkBNB. Every account on ZkBNB gets its short name, user can use that to
store funds and receive any cryptocurrency, token, or NFT.
Expand Down
23 changes: 0 additions & 23 deletions common/chain/balance_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,13 @@ func ComputeNewBalance(assetType int64, balance string, balanceDelta string) (ne
return "", err
}
assetInfo.Balance = ffmath.Add(assetInfo.Balance, assetDelta.Balance)
assetInfo.LpAmount = ffmath.Add(assetInfo.LpAmount, assetDelta.LpAmount)
if assetDelta.OfferCanceledOrFinalized == nil {
assetDelta.OfferCanceledOrFinalized = types.ZeroBigInt
}
if assetDelta.OfferCanceledOrFinalized.Cmp(types.EmptyOfferCanceledOrFinalized) != 0 {
assetInfo.OfferCanceledOrFinalized = assetDelta.OfferCanceledOrFinalized
}
newBalance = assetInfo.String()
case types.LiquidityAssetType:
// balance: LiquidityInfo
liquidityInfo, err := types.ParseLiquidityInfo(balance)
if err != nil {
return "", err
}
deltaLiquidity, err := types.ParseLiquidityInfo(balanceDelta)
if err != nil {
return "", err
}
liquidityInfo.AssetAId = deltaLiquidity.AssetAId
liquidityInfo.AssetBId = deltaLiquidity.AssetBId
liquidityInfo.AssetA = ffmath.Add(liquidityInfo.AssetA, deltaLiquidity.AssetA)
liquidityInfo.AssetB = ffmath.Add(liquidityInfo.AssetB, deltaLiquidity.AssetB)
liquidityInfo.LpAmount = ffmath.Add(liquidityInfo.LpAmount, deltaLiquidity.LpAmount)
if deltaLiquidity.KLast.Cmp(types.ZeroBigInt) != 0 {
liquidityInfo.KLast = deltaLiquidity.KLast
}
liquidityInfo.FeeRate = deltaLiquidity.FeeRate
liquidityInfo.TreasuryAccountIndex = deltaLiquidity.TreasuryAccountIndex
liquidityInfo.TreasuryRate = deltaLiquidity.TreasuryRate
newBalance = liquidityInfo.String()
case types.NftAssetType:
// just set the old one as the new one
newBalance = balanceDelta
Expand Down
152 changes: 0 additions & 152 deletions common/chain/liquidity_helper.go

This file was deleted.

83 changes: 0 additions & 83 deletions common/chain/liquidity_helper_test.go

This file was deleted.

Loading