guagualvcha

guagualvcha

keep learning

Member Since 7 years ago

Experience Points
95
follower
Lessons Completed
18
follow
Lessons Completed
15
stars
Best Reply Awards
37
repos

852 contributions in the last year

Pinned
⚡ libp2p implementation in Go
⚡ ⟁ Tendermint Core (BFT Consensus) in Go
⚡ Go implement of a Simple Write-ahead Logger
Activity
Oct
22
1 day ago
pull request

guagualvcha merge to binance-chain/BEPs

guagualvcha
guagualvcha

update bep index

Add missing new beps in readme.

pull request

guagualvcha merge to binance-chain/BEPs

guagualvcha
guagualvcha

BEP-95: Introduce Real-Time Burning Mechanism

BEP-95: Introduce Real-Time Burning Mechanism

1. Summary

This BEP introduces a real-time burning mechanism into the economic model of BSC.

2. Abstract

To speed up the burning process of BNB and make BSC more decentralized, part of the gas fee will be burned. It includes two parts:

  • A fixed ratio of the gas fee collected by the validators will be burned in each block.
  • The burning ratio can be governed by the BSC validators.

3. Status

This BEP is a draft.

4. Motivation

The burning of gas fees can speed up the burning process of BNB and improve the intrinsic value of BNB.

The BNB holders will decide how to dispatch the gas reward of BSC.

Though the staking reward of the validators and delegators may decrease in BNB amount, the reward value in dollars may increase in the long run with the increase of BNB value and a more active ecosystem.

5. Specification

5.1 Gas Fee Distribution

As BNB is not an inflationary token, there will be no mining rewards as what Bitcoin and Ethereum networks generate, and the gas fee is the major reward for validators. As BNB is also utility tokens with other use cases, delegators and validators will still enjoy other benefits of holding BNB. The gas fee is collected each block and distributed to two system smart contracts:

  1. System Reward Contract. The contract can possess at most 100 BNB. 1/16 of the gas fee will be transferred to the system reward contract if it possesses less than 100 BNB. The funding within the reward contract is used as cross-chain package subsidies.
  2. ValidatorSet Contract. The rest of the gas fee is transferred to the ValidatorSet contract. It is the vault to keep gas fees for both validators and delegators. The funding within the contract will be transferred to Binance Chain and distributed to delegators and validators according to their shares every day.

5.2 Burning Mechanism

A governable parameters: burnRatio will be introduced in the ValidatorSet Contract. At the end of each block, the Validator will sign a transaction to invoke the deposit function of the contract to transfer the gas fee. The burning logic is implemented within the deposit function that: burnRatio * gasFee will be transferred to the burn address;

The initial setting:

  • burnRatio = 10%

5.3 Governance

The change of burnRatio will be determined by BSC Validators together through a proposal-vote process based on their staking.

This process will be carried on Binance Chain, every community member can propose a change of the params. The proposal needs to receive a minimum deposit of BNB (2000BNB on mainnet for now, refundable after the proposal has passed) so that the validator can vote for it. The validators of BSC can vote for it or against it based on their staking amount of BNB.

If the total voting power of bounded validators that votes for it reaches the quorum(50% on mainnet), the proposal will pass and the corresponding change of the params will be passed onto BSC via cross-chain communication and take effect immediately. The vote of unbounded validators will not be considered into the tally.

6. License

The content is licensed under CC0.

Oct
21
2 days ago
push

guagualvcha push binance-chain/bsc

guagualvcha
guagualvcha

add metrics for contract code bitmap cache

Signed-off-by: kyrie-yl [email protected]

guagualvcha
guagualvcha

Merge pull request #472 from binance-chain/bitmap_cache_metrics

[R4R]add metrics for contract code bitmap cache

commit sha: 60e92c1b145a07af25ec1c84ead646ca34d4ca32

push time in 2 days ago
pull request

guagualvcha pull request binance-chain/bsc

guagualvcha
guagualvcha

[R4R]add metrics for contract code bitmap cache

Signed-off-by: kyrie-yl [email protected]

Description

add hit and miss metrics for contract code bitmap cache

Rationale

to get the cache hit rate of contract bitmap cache

Example

Changes

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

Oct
20
3 days ago
pull request

guagualvcha merge to binance-chain/bsc

guagualvcha
guagualvcha

add metrics for contract code bitmap cache

Signed-off-by: kyrie-yl [email protected]

Description

add hit and miss metrics for contract code bitmap cache

Rationale

to get the cache hit rate of contract bitmap cache

Example

Changes

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

Activity icon
created tag
createdAt 3 days ago
Activity icon
delete
deleted time in 3 days ago
push

guagualvcha push binance-chain/bsc

guagualvcha
guagualvcha
guagualvcha
guagualvcha

Merge pull request #471 from guagualvcha/down_nil_issue

[R4R]fix downloader nil issue when the header is mising

commit sha: b6035c1afaf03bbffbde5c83cc57b7e57325a7a1

push time in 3 days ago
pull request

guagualvcha pull request binance-chain/bsc

guagualvcha
guagualvcha

[R4R]fix downloader nil issue when the header is mising

Description

fix downloader nil issue when the header is mising

Rationale

still refer to the header when the header is nil

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

pull request

guagualvcha pull request binance-chain/bsc

guagualvcha
guagualvcha

[R4R]fix download nil issue

Description

add a description of your changes here...

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

Activity icon
created branch

guagualvcha in guagualvcha/bsc create branch down_nil_issue

createdAt 3 days ago
pull request

guagualvcha pull request binance-chain/BEPs

guagualvcha
guagualvcha

BEP91: raise gaslimit from 70MM to 100MM

Recently, the BSC Blocks start hitting the gasceil daily: image

The increasing prevalence of blocks near the limit may lead to increased fees and delays in the processing of transactions in the future.

I propose to raise the gas limit from 75MM to 100MM to relieve the network congestion.

Activity icon
created tag
createdAt 3 days ago
Activity icon
delete
deleted time in 3 days ago
Activity icon
created tag
createdAt 3 days ago
Activity icon
delete
deleted time in 3 days ago
Activity icon
created tag
createdAt 3 days ago
push

guagualvcha push binance-chain/bsc

guagualvcha
guagualvcha

add block proccess backoff time when validator is not in turn

guagualvcha
guagualvcha
guagualvcha
guagualvcha

[R4R]implement diff sync (#376)

  • implement block process part of light sync

  • add difflayer protocol

  • handle difflayer and refine light processor

  • add testcase for diff protocol

  • make it faster

  • allow validator to light sync

  • change into diff sync

  • ligth sync: download difflayer (#2)

  • ligth sync: download difflayer

Signed-off-by: kyrie-yl [email protected]

  • download diff layer: fix according to the comments

Signed-off-by: kyrie-yl [email protected]

  • download diff layer: update

Signed-off-by: kyrie-yl [email protected]

  • download diff layer: fix accroding comments

Signed-off-by: kyrie-yl [email protected]

Co-authored-by: kyrie-yl [email protected]

  • update light sync to diff sync

  • raise the max diff limit

  • add switcher of snap protocol

  • fix test case

  • make commit concurrently

  • remove peer for diff cache when peer closed

  • consensus tuning

  • add test code

  • remove extra message

  • fix testcase and lint

make diff block configable

wait code write

fix testcase

resolve comments

resolve comment

  • resolve comments

  • resolve comments

  • resolve comment

  • fix mistake

Co-authored-by: kyrie-yl [email protected] Co-authored-by: kyrie-yl [email protected]

guagualvcha
guagualvcha

Export get diff accounts in block api (#431)

  • support get diff accounts

Signed-off-by: Keefe-Liu [email protected]

  • add testcase for diff accounts

Signed-off-by: Keefe-Liu [email protected]

guagualvcha
guagualvcha

ignore empty tx in GetDiffAccountsWithScope

Signed-off-by: Keefe-Liu [email protected]

guagualvcha
guagualvcha

fix blockhash not correct for the logs of system tx receipt (#444)

guagualvcha
guagualvcha

Merge pull request #442 from KeefeL/diff_accouts

ignore empty tx in GetDiffAccountsWithScope

guagualvcha
guagualvcha

fix concurrent write seen of subfetcher (#446)

guagualvcha
guagualvcha

Merge pull request #426 from binance-chain/improve_backoff

[R4R] add block proccess backoff time when validator is not in turn and received in turn block

guagualvcha
guagualvcha

[R4R] add extension in eth protocol handshake to disable tx broadcast (#412)

  • add extension for eth protocol handshake

  • fix comments

guagualvcha
guagualvcha

cache bitmap and change the cache type of GetCode (#449)

  • change cache type of GetCode from fastcache to lrucache

Signed-off-by: kyrie-yl [email protected]

  • add cache for contract code bitmap

Signed-off-by: kyrie-yl [email protected]

  • core/vm: rework jumpdest analysis benchmarks (#23499)

  • core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB and classic benchmark loop.

  • core/vm: clear bitvec in jumpdest analysis benchmark

Co-authored-by: Paweł Bylica [email protected]

guagualvcha
guagualvcha

parallel bloom calculation (#445)

  • parallel bloom calculation

  • indent

  • add condition if bloomJobs not nil

  • add handler for worker

  • fix format

  • bloomWorker should exit when all txs have been processed

  • rename BloomPair => BloomHash

  • add size to map

  • rename & unique variable

  • bloomJobs => bloomProcessors

  • fix

  • only assign bloom if empty

  • abstraction method for processing receipt bloom

  • remove duplicate receipt_processor

  • rename Processor

  • fix ReceiptProcessor

  • fix ReceiptBloomGenertor typo

  • reduce worker to 1

  • remove empty wg

  • add defence code to check if channel is closed

  • remove nil

  • format fix

  • remove thread pool

  • use max 100 worker capacity

  • reduce worker size

  • refactor startWorker

guagualvcha
guagualvcha

fix cache key do not have hash func (#455)

Signed-off-by: kyrie-yl [email protected]

guagualvcha
guagualvcha

ci: unit test and truffle test (#456)

  • ci: add unit test

fix: failed on test

  • ci: add truffle test

  • ci: update os version

  • ci: add cache for go build

guagualvcha
guagualvcha

commit sha: 4edd2b105d07e3f256266bc6df547efff07d5c1f

push time in 3 days ago
pull request

guagualvcha pull request binance-chain/bsc

guagualvcha
guagualvcha

[R4R] Release v1.1.3

Description

Release v1.1.3 introduces a lot of performance improvement.

It also introduce diff sync which help node sync faster.

Rationale

Improvement

  • #456 git-flow support lint, unit test, and integration test
  • #449 cache bitmap and change the cache type of GetCode
  • #454 fix cache key do not have hash func
  • #446 parallel bloom calculation
  • #442 ignore empty tx in GetDiffAccountsWithScope
  • #426 add block proccess backoff time when validator is not in turn and received in turn block
  • #398 ci pipeline for release page

BUGFIX

  • #446 fix concurrent write of subfetcher
  • #444 fix blockhash not correct for the logs of system tx receipt
  • #409 fix nil point in downloader
  • #408 core/state/snapshot: fix typo

FEATURES

  • #431 Export get diff accounts in block api
  • #412 add extension in eth protocol handshake to disable tx broadcast
  • #376 implement diff sync

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

push

guagualvcha push binance-chain/BEPs

guagualvcha
guagualvcha

Merge pull request #114 from binance-chain/bep93

[R4R]add bep93: Diff Sync Protocol on BSC

commit sha: e1d408af3ca275c03bc314900fe2e13a591ebe03

push time in 3 days ago
pull request

guagualvcha pull request binance-chain/BEPs

guagualvcha
guagualvcha

[R4R]add bep93: Diff Sync Protocol on BSC

BEP-93: Diff Sync Protocol on BSC

1. Summary

This BEP introduces a new sync mode named diff sync on the Binance Smart Chain.

2. Abstract

BEP-93 Proposal describes a fast block syncing protocol to lower the hardware requirement for running a BSC client. A BSC client can simply apply the execution result of a block securely without executing the transactions.

Currently, BSC has three kinds of sync mode:

  1. Snap sync;
  2. Fast sync;
  3. Full sync.

Snap sync and fast sync are used for the initial synchronization, once the client has the entire state and all historical block data, it will switch to full sync automatically.

It takes several steps to process a block when doing full sync:

  1. Fetch/Receive blocks from other peers through p2p network.
  2. Verify header and block body.
  3. Execute transactions within EVM.
  4. Calculate the root hash of MPT.
  5. Commit MPT to memory DB, persist snapshot and MPT to disk if necessary.

In most cases, step 3 occupied 70+% of the block processing time.

This BEP proposes a diff sync protocol without executing transactions, in exchange, the security of a fullnode will degrade to a light client, but meanwhile the node can still keep the full state and blocks of the network. This will benefit the small node so that they can still be used as full nodes and participate in the light verification of the network.

3. Status

Draft.

4. Motivation

The increasing adoption of BSC leads to a more active network. Blocks on BSC start hitting the gasceil daily, and the BSC network will increase the capacity further. On the other hand, the node maintainer had a hard time keeping their node catching up with the chain. A light syncing protocol to lower the hardware requirement is an urgent need.

5. Specification

5.1 Diff Protocol

A new protocol named diff will run on top of the p2p network besides eth and snap. Four kinds of packages are defined under the diff protocol:

  1. DiffCapMsg. It is used to exchange whether the peer supports diff sync during the handshake.
  2. GetDiffLayerMsg. It is used to request diff layers from other peers.
  3. DiffLayerMsg. It is used to broadcast diff layers to other peers.
  4. FullDiffLayerMsg. It is a response to GetDiffLayerMsg which contains the diff layers.

Diff layer is the execution result of a block, it contains:

  1. BlockHash.
  2. Number. The height of the block.
  3. Receipts. The receipts of the block.
  4. Codes. The newly created smart contract code within the block.
  5. Destructs. The destroyed accounts within the block.
  6. Accounts. The account change within the block.
  7. Storages. The storage change within the block.

5.2 Sync Diff Layer

Untitled Diagram drawio

Workflow:

  1. P2P nodes full sync a block and cache the generated diff layer.
  2. (optional)The generated diff layer can be persisted if it is on the canonical chain.
  3. P2P nodes may receive diff layers from other peers, will cache it in an untrusted diff layer set.
  4. P2P node will broadcast diff layers to parts of connected peers.
  5. P2P nodes will pick diff layers from the cache, disk, and untrusted set to respond to requests from other peers.
  6. A full node can fetch diff layers from other peers
  7. A full node can apply the diff layers to MPT and Snapshot without executing transactions, it is called light process. If the light process failed, the full node will fall back to full sync.

5.3 Security

The diff sync protocol guarantees 1. Light client security; 2. State consistency.

It sustains 1. Validator collusion 2. Short fork with an invalid state.

For validator collusion, the full node will randomly full sync to prevent applying a false state caused by validator collusion.

For short fork with an invalid state, it is highly recommended that at least 21 blocks are needed to reach finality for a diff sync client.

6. License

The content is licensed under CC0.

push

guagualvcha push binance-chain/bsc-bew-contracts

guagualvcha
guagualvcha
guagualvcha
guagualvcha

Merge pull request #3 from binance-chain/fix_seq

fix import sequence

commit sha: 3d64baa7bc77b77c04db23aa127f72a16bcf1025

push time in 3 days ago
pull request

guagualvcha pull request binance-chain/bsc

guagualvcha
guagualvcha

Create Who-go-swap

Description

add a description of your changes here...

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

pull request

guagualvcha pull request binance-chain/bsc

guagualvcha
guagualvcha

Credit me

Description

Review add a description of your changes here...

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

Previous