Skip to content

Instantly share code, notes, and snippets.

@trustfarm-dev
Created October 14, 2016 09:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save trustfarm-dev/cbbc9aa1ab76983cb7dbaa329097c1c3 to your computer and use it in GitHub Desktop.
Save trustfarm-dev/cbbc9aa1ab76983cb7dbaa329097c1c3 to your computer and use it in GitHub Desktop.
Ethereum Contract GasFee Autochange Idea. review on recent DDOS attacks.
(ENG) Ethereum-gas-fee-autochange.txt
Ethereum Contract GasFee Autochange Idea. review on recent DDOS attacks.
From the beginning ethereum has object to be a world computer and smart contract coin platform.
Recent days of DDOS attacks, ETHEREUM normal node (geth , parity) has over consumed 16GB of Runtime memory and sometimes stuck over 10s minutes, or finally, Out of Memory error occurs and down.
It's not suitable for lite IoT systems, it needs less consume of run-time memory, not by sw footprint.
If operate nodes, that's possible to lite client which connect remote full nodes.
Thus, It needs new method for limit memory usage and new forked node sw might be come out.
And, next monday (16th Oct,2016) plan to EVM instruction Gas Value increasing hard fork on Ethereum nodes (geth,parity).
Even though GAS price is increase, It'll not full cover prevent DDOS.
Cracker who try DDOS, needs tremendous GAS fee, but, There's another way to attack, they try to find.
But, Increasing GAS fee, It'll very helpful to prevent DDOS. It's clear.
So, I've thought Realtime Gas Fee auto changing idea. like a Exchange.
1. some minutes, or some hours, get statistics in contract usage transaction, some instruction's usage count has increase then increase Gas fee of that instruction, and longer time not using then decrease gas fee, and finally default gas fee.
2. Many usage of contract, they want to save Gas fee, register contract to nodes sw with given contract address.
This verified contract will consume less Gas fee.
In this case, Contract verification and certification will do by 3rd party trusted community or eth foundation.
And should pay Registration and Certification fee.
It's kind of Official Contract code certification system.
3. New custom contract using, same contract code is executed 100, 1000, 10000 times and that's verified counts has increasing, discount gas fee by execution ratio, but always over default gas fee.
At first several times of execution of Contract, It needs a little bit expensive gas costs.
This kinds of algorhitm will be helpful prevent contract DDOS attacks.
But, Another Cons are ::
- Decrease custom contract developments will and action.
- Denial of Certification. It's a central-controlling-behavior.
And Another idea will alternatives...
next time ~~~~
Base ideation come from Gas Fee Autochange based on Realtime block transaction statistics.
Gas비 자동변경에 대한 아이디어.
애시 당초 ETHEREUM 을 보면, computer 와 smart contract 이 동작할수있는 코인 플랫폼이었다.
최근 DDOS 를 보았을때, ETHEREUM 노드가 잡아먹는 런타임 메모리가 16GB 가 넘어가고, 노드가 몇 10분을 헤메다, 뻣거나 이렇게 되었다.
lite 한 IoT 시스템에 올리기에는 소프트 사이즈가 문제가 아닌, 런타임 메모리 사용때문에 현실적으로 불가한 상황이다.
굳이 한다고 해도, 원격지 서버 노드에 접속해서 클라이언트 기능만 넣을수있지, Full node 는 힘든 상황이다.
메모리 제한을 할수있는 새로운 방법이 있어야 하고, 이를 적용한 포크 노드가 나와야 한다.
Gas 가격을 올리는 하드 포크를 하더라도, DDOS 를 막기는 힘들것이다.
단, DDOS 하려고 하는 자는 엄청난 가스 비용을 감내 해야 하는 상황인 것이지만, 다른 공격 루트는 또 찾을 것이기 때문이다.
하지만, Gas 비를 조정함으로서 DDOS 를 막는데는 상당한 도움을 줄것이다.
그래서, 거래소 처럼 실시간으로 Gas 사용비를 올렸다 내렸다 하는 블록체인 노드 시스템이 되었으면 어떨가 한다.
1. 최근의 DDOS 나 Contract 이 빈번해져서, 전체 네트워크 상 트랜잭션에서 일정시간 수분 또는 수시간 , 특정 instruction 의 사용빈도가 높았다면, 자동으로 네트워크 통계를 기반으로 해당 instruction 의 가격이 올라간다.
사용하지 않으면, 기본값으로 환원한다.
2. 기존 contract 중에서 Gas 비를 싸게 하기 위해서는 기존 기능중 많이 쓰는 contract 은 노드자체와 연결된 계정으로 등록을 하게 하여,
이컨트랙은 표준 Gas 비를 사용하여, Ethereum 기본 노드에 contract 서비스로 등록한다.
물론, Contract 에 대한 검증은 제3의 community 및 ethereum 재단 쪽에서 한다.
등록하려면 등록 Fee 를 납입한다. 일종의 Contract Certification 시스템이다.
3. 신규 Contract 을 만들어서 사용할때는 그 Contract 이 100번 1000번 10000번 사용해서 검증되기전에는 초기 Gas 비를 자동으로 높게 책정한다. 통계는 일정시간 block 안에 들어와 있는 contract 의 hash값을 기준으로 비교한다. contract 이 사용된 시간과 횟수에 따라서, Gas 비의 discount 되게 한다.
이때, 최종 Gas 사용비용은 초기 설정된 Gas 비 보다 높게 책정된다.
이런 방안을 적용할수있다면, DDOS 를 막는데, 일정부분 역활을 할수있을것 같네요.
하지만, custom contract 의 개발은 많이 위축될수있겠어요.
또한, Certification 에 대한 거부감도 상당히 있을것 같구요.
이에 대한, 또다른 대안방안은 여럿있지만,
오늘은 여기까지 ~
기본 아이디어는 실시간 블록 트랜잭션 통계 기반의 Gas 비 자동변경방안 입니다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment