I Failed the Turing Test
When in doubt, overengineer.
-
Updated
Demystifying Solidity ABI Encoding
Category: Blockchain
There are many encode functions in Solidity: abi.encode(), abi.encodePacked(), abi.encodeWithSignature(), and abi.encodeCall(). Which one to use, and when.
-
Updated
Build Docker Images using Google Cloud Build from Your GitHub Repository
Category: DevOps
Triggering a Docker image build on Google Cloud Build when pushing commits to a GitHub repository.
-
Updated
Solidity: Read Contract Storage by Slots with Foundry
Category: Blockchain
State variables are stored in different "slots" in a contract, and each slot is 32 bytes (256 bits). However, multiple adjacent state variables declared in the contract may be packed into the same slot by the Solidity compiler if their combined size does not exceed 32 bytes.
-
Updated
Surviving the Digital Dark Forest: Tips for Staying Safe Online
Category: Misc
How I learned to "start worrying" and to embrace the illusion of safety.
-
Updated
Solidity: CREATE vs CREATE2
Category: Blockchain
How to deploy a contract using `CREATE2` which is introduced in EIP-1014 to provide more flexible address generation.
-
Updated
Solidity: calldata, memory, and storage
Category: Blockchain
If you can, try to use calldata as data location because it will avoid copies, reduce gas usage, and also make sure that the data cannot be modified.
-
Updated
hardhat-deploy: Upgradeable Contracts with Linked Libraries
Category: Blockchain
Whenever the library is changed, hardhat-deploy will deploy a new implementation and upgrade the proxy.
-
Updated
Deploy Ethereum RPC Provider Load Balancer with HAProxy in Kubernetes (AWS EKS)
Category: Blockchain, DevOps
Put a HAProxy load balancer in front of multiple Ethereum RPC providers, and adjust traffic weights by the latency and block timestamp of each endpoint.
-
Updated
Deploy graph-node (The Graph) in Kubernetes (AWS EKS)
Category: Blockchain, DevOps
Two ways to run a self-hosted graph-node on Amazon EKS: a single node with one PostgreSQL database, or a cluster with a primary-secondary PostgreSQL cluster.
-
Updated
Amazon EKS: Setup Cluster Autoscaler
Category: DevOps, Web Development
Cluster Autoscaler adjusts the number of nodes when pods fail to schedule. Here we deploy the AWS implementation on Amazon EKS.