Skip to content

Instantly share code, notes, and snippets.

View denniswon's full-sized avatar

Dennis Won denniswon

View GitHub Profile
@denniswon
denniswon / gist:fa64ab390de045be9f5c128ae0e72e3a
Created April 13, 2025 18:39
RiscZero zkVM Intel TDX quote verification proving profiling result
## Profiling Output
```bash
# RISC0_PPROF_OUT=./profile.pb RUST_LOG=info RISC0_DEV_MODE=1 RISC0_INFO=1 cargo run
ImageID: 70c5862009c0dc522d29dc7e0bfe181b41c2b8ad1a10fcb24b1d14b4dd07999c
WARNING: proving in dev mode. This will not generate valid, secure proofs.
2025-04-13T18:26:14.997940Z INFO risc0_zkvm::host::server::exec::executor: execution time: 542.834583ms
2025-04-13T18:26:14.998158Z INFO risc0_zkvm::host::server::session: number of segments: 6
2025-04-13T18:26:14.998180Z INFO risc0_zkvm::host::server::session: 5767168 total cycles
@denniswon
denniswon / git-reset-author.sh
Created April 8, 2025 05:52 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
const hashes = [
'95cd603fe577fa9548ec0c9b50b067566fe07c8af6acba45f6196f3a15d511f6',
'709b55bd3da0f5a838125bd0ee20c5bfdd7caba173912d4281cae816b79a201b',
'27ca64c092a959c7edc525ed45e845b1de6a7590d173fd2fad9133c8a779a1e3',
'1f3cb18e896256d7d6bb8c11a6ec71f005c75de05e39beae5d93bbd1e2c8b7a9',
'41b637cfd9eb3e2f60f734f9ca44e5c1559c6f481d49d6ed6891f3e9a086ac78',
'a8c0cce8bb067e91cf2766c26be4e5d7cfba3d3323dc19d08a834391a1ce5acf',
'd20a624740ce1b7e2c74659bb291f665c021d202be02d13ce27feb067eeec837',
'281b9dba10658c86d0c3c267b82b8972b6c7b41285f60ce2054211e69dd89e15',
'df743dd1973e1c7d46968720b931af0afa8ec5e8412f9420006b7b4fa660ba8d',
@denniswon
denniswon / beeper-minimal.css
Last active October 18, 2024 00:01
beeper-minimal.css
body {
font-family: 'Space Grotesk';
}
/******************************************************************/
/* Ensure 'report bug' dialog doesn't take over the entire screen */
/******************************************************************/
#mx_Dialog_Container div[aria-describedby="report_bug"] {
/* Don't take up the entire screen */
width: fit-content;
body {
font-family: 'Space Grotesk';
}
.rooms_filters p {
font-size: 11px;
}
.favourites__row {
padding-top: 12px;

How to Add a Precompile to Geth

In this tutorial, we will walk through how to create your own precompile and add it to Geth.

What Is a Precompile in Geth?

In Geth, precompiles are a set of stateless contracts. But unlike Solidity code, their logic isn't in the smart contract code itself—they are part of the Geth client. You can think of a precompile as an interface that can execute Go code that resides within the Geth client.

How Precompiles Are Implemented in Geth

The logic for precompiles in Geth is located in the core/vm/contracts.go file.

@denniswon
denniswon / ts
Last active April 26, 2024 03:32
split-rpc-client.ts
const client = createBundlerClient({
chain,
transport: (opts) => {
const bundlerRpc = http(`${BUNDLER_RPC}`)(opts);
const paymasterRpc = http(`${PAYMASTER_RPC}`)(opts);
const publicRpc = http(`${PUBLIC_RPC}`)(
opts
);
return custom({
@denniswon
denniswon / gist:27a928775468564ecd3f872f48ebedb6
Created April 26, 2024 03:24
split rpc for bundler, paymater and public rpc
const client = createBundlerClient({
chain,
transport: (opts) => {
const bundlerRpc = http(`${rpcUrl}/${API_KEY_STAGING}`)(opts);
const publicRpc = http(`${chain.rpcUrls.alchemy.http[0]}/${API_KEY}`)(
opts
);
return custom({
request: async (args) => {
brew bundle
Tapping homebrew/cask
Error: Tapping homebrew/cask is no longer typically necessary.
Add --force if you are sure you need it done.
Tapping homebrew/cask has failed!
Using homebrew/cask-fonts
Using pulumi/tap
Using rosetta2
Using alchemy-homebrew
Using alchemy-gh
@denniswon
denniswon / 0001-fix-viem-patch-for-unblocking-aa-sdk.patch
Last active November 2, 2023 02:00
uniswap + acocuntkit: viem patch
From 7d6d248f48f387d121a312d61948ee017cbca861 Mon Sep 17 00:00:00 2001
From: Dennis Won <[email protected]>
Date: Wed, 1 Nov 2023 17:50:39 -0700
Subject: [PATCH] fix: viem patch for unblocking aa-sdk
---
package.json | 3 +-
patches/viem+1.18.1.patch | 1292 +++++++++++++++++++++++++++++++++++++
yarn.lock | 66 +-
3 files changed, 1356 insertions(+), 5 deletions(-)