Skip to content

Instantly share code, notes, and snippets.

View denniswon's full-sized avatar

Dennis Won denniswon

View GitHub Profile
@denniswon
denniswon / tdx-prover-log.txt
Created April 25, 2025 01:06
tdx prover log
2025-04-25T01:00:03.398028Z INFO tdx_prover::config::database: Connected to the database!
2025-04-25T01:00:03.699267Z INFO tdx_prover::lambda::function: Attestation found for request ID: 43c16556-7f70-4aa3-94da-2942ede2e2b2 failure
All collaterals found! Begin uploading input to SP1 Proving Server...
2025-04-25T01:00:22.008822Z INFO execute: sp1_core_executor::executor: clk = 0 pc = 0x2032e8
stderr: WARNING: Using insecure random number generator.
2025-04-25T01:00:30.369843Z INFO execute: sp1_prover: gas: 8173962
2025-04-25T01:00:43.886792Z INFO execute: sp1_core_executor::executor: clk = 0 pc = 0x2032e8
stderr: WARNING: Using insecure random number generator.
2025-04-25T01:00:52.200869Z INFO execute: sp1_prover: gas: 8173962
2025-04-25T01:00:52.202480Z INFO sp1_sdk::network::prover: Requesting proof:
@denniswon
denniswon / tdx-prover-log.txt
Created April 24, 2025 17:00
tdx-prover.log
2025-04-24T16:55:23.594919Z INFO tdx_prover::config::database: Connected to the database!
2025-04-24T16:55:23.910516Z INFO tdx_prover::lambda::function: Attestation found for request ID: 43c16556-7f70-4aa3-94da-2942ede2e2b2 pending
All collaterals found! Begin uploading input to SP1 Proving Server...
2025-04-24T16:55:46.919634Z INFO execute: sp1_core_executor::executor: clk = 0 pc = 0x2032e8
stderr: WARNING: Using insecure random number generator.
2025-04-24T16:55:58.300919Z INFO execute: sp1_prover: gas: 8173962
2025-04-24T16:56:26.706107Z INFO execute: sp1_core_executor::executor: clk = 0 pc = 0x2032e8
stderr: WARNING: Using insecure random number generator.
2025-04-24T16:56:43.714033Z INFO execute: sp1_prover: gas: 8173962
2025-04-24T16:56:43.721050Z INFO sp1_sdk::network::prover: Requesting proof:
@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) => {