devops

Arbitrum Transaction GasPrice 0 테스트 본문

DevOps/Chain

Arbitrum Transaction GasPrice 0 테스트

vata500 2023. 4. 11. 22:00
반응형

gasUsed 0으로 트랜잭션 발생에 가스비가 사용되지 않음

서비스 테스트를 위해서, 자체적으로 구축한 아비트럼 체인의 TxGas 수수료를 제로로 하는 테스트를 진행했다.

Blockscout로 확인한 Transaction Details

짧은 시간에 Tx가 많이 요구되는 서비스라면 사용자 경험을 최적화하기 위해서, 가스비를 0로 해야할 수 있다. 서비스 테스팅을 위해서 아래 local-dev-node 방식으로 일부 코드를 수정하여 체인을 구축했다.

https://developer.arbitrum.io/node-running/local-dev-node

 

Running a local dev node | Arbitrum Documentation Center

1. Install

developer.arbitrum.io

아비트럼의 가스비는 ETH로 사용되며, Arbos의 L2Pricing 기능을 통해서 비용이 결정되는데, Arbos가 Nitro 노드의 Middle layer기 때문에 Base layer인 Geth Core의 코드의 수정도 필요하다. 

# arbos/l2pricing/model.go

const InitialSpeedLimitPerSecondV0 = 1000000
const InitialPerBlockGasLimitV0 uint64 = 20 * 1000000
const InitialSpeedLimitPerSecondV6 = 7000000
const InitialPerBlockGasLimitV6 uint64 = 32 * 1000000
const InitialMinimumBaseFeeWei = params.GWei / 10
const InitialBaseFeeWei = InitialMinimumBaseFeeWei * 0 #
const InitialGasPoolSeconds = 10 * 60
const InitialRateEstimateInertia = 60
const InitialPricingInertia = 102
const InitialBacklogTolerance = 10
# Arbos L2PricingState

type L2PricingState struct {
	storage             *storage.Storage
	gasPool             storage.StorageBackedInt64
	smallGasPool        storage.StorageBackedInt64
	gasPoolSeconds      storage.StorageBackedUint64
	smallGasPoolSeconds storage.StorageBackedUint64
	gasPriceWei         storage.StorageBackedBigInt
	minGasPriceWei      storage.StorageBackedBigInt
	maxGasPriceWei      storage.StorageBackedBigInt // the maximum price ArbOS can set without breaking geth
	speedLimitPerSecond storage.StorageBackedUint64
	maxPerBlockGasLimit storage.StorageBackedUint64
}

내가 살펴본 바로는 Arbos에서 L2Pricing에 영향을 주는 파라미터 설정(l2pricing/model.go)되면 User Demand와 Geth state 및 Computation Speed Limit 등의 요소를 고려해서 L2PricingState(l2pricing/l2pricingstate.go)를 통해 L2 가격을 결정한다. 

그래서 InitialBaseFeeWei와 UpdatePricingModel()을 통한 SetBaseFeeWei() 메소드의 인자값을 변경해야한다.

또한, Arbos는 Nitro 노드의 하나의 레이어로 실제 evm contract 실행과 state 구성에 Geth core가 담당하기 때문에 초기 TxGas 파라미터의 수정(go-ethereum/params/protocol_params.go)도 요구된다.

가스비를 제거했기 때문에 무분별한 Tx 전송으로 인한 디도스 공격과 대량의 Tx에 의한 Batch post의 레이턴시를 감안해야한다. 


https://research.arbitrum.io/t/challenging-periods-reimagined-the-key-role-of-sequencer-decentralization/9189

 

Challenging Periods Reimagined: The Key Role of Sequencer Decentralization

Check out the complete second part of the Challenging Periods Reimagined Series by clicking here. This part focuses on sequencer decentralization and its integration into our proposed dynamic challenging period model. If you have not read the first part, w

research.arbitrum.io

아비트럼은 직접적으로 L2 가스비를 수취하는 시퀀서를 탈중앙화할 계획이다. 이를 위해서 Governance adjusted time과 Multi-chain multi-slot sequencer selection process, Penalizing a seqeuncer 등 의 방법이 논의되고 있다.

여기서 Sequencer가 아비트럼 체인에서 활동할 주요 동기요인은 역시나 유저들의 L2 트랜잭션 수수료를 통한 수익이다.

Sequencer 노드는 L2 수수료의 일부를 수취하고 나머지는 network fee pool로 이동하여 L2 tx, L1 calldata와 Computation 및 Storage를 위해 사용된다.

결론적으로, 점진적으로 노드의 '탈중앙화'를 고려한다면 가스비가 0이어선 안된다. 가스비를 없애는 건, 오로지 단일 Dapp을 위한 프라이빗 L2에서만 가능한 구조다.

반응형
Comments