@rhinestone/service-sdk 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAG1D,KAAK,mBAAmB,GAAG,IAAI,CAC7B,YAAY,EACZ,oBAAoB,GAAG,eAAe,CACvC,CAAA;AAmFD,wBAAsB,eAAe,CACnC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAU3B"}
1
+ {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAW1D,KAAK,mBAAmB,GAAG,IAAI,CAC7B,YAAY,EACZ,oBAAoB,GAAG,eAAe,CACvC,CAAA;AAuGD,wBAAsB,eAAe,CACnC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAU3B"}
package/dist/chains.js CHANGED
@@ -3,12 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.estimateGasFees = estimateGasFees;
4
4
  const chains_1 = require("viem/chains");
5
5
  // Chains that price fees from a windowed eth_feeHistory instead of viem's
6
- // default estimator — the volatile-base L1s, where windowing the next-block base
7
- // fee and pooling tips across the window smooths the single-block noise that
8
- // made the latest-block-only read jumpy. Other chains stay on viem's default
9
- // (some with a tip-floor overlay, see TIP_FLOOR_WEI): their base fee is stable
10
- // or sequencer-pinned, so windowing adds nothing.
11
- const HISTORICAL_FEE_CHAINS = new Set([chains_1.sepolia.id, chains_1.mainnet.id]);
6
+ // default estimator. Two membership rationales:
7
+ // - volatile-base L1s (mainnet, sepolia): windowing the next-block base fee
8
+ // and pooling tips across the window smooths the single-block noise that
9
+ // made the latest-block-only read jumpy;
10
+ // - broken-tip-oracle chains (Plasma): eth_maxPriorityFeePerGas over-prices
11
+ // the tip by orders of magnitude vs the chain's real rewards, and this path
12
+ // never consults the oracle — see FEE_CONFIG_OVERRIDES for the specifics.
13
+ // Other chains stay on viem's default (some with a tip-floor overlay, see
14
+ // TIP_FLOOR_WEI): their base fee is stable or sequencer-pinned, so windowing
15
+ // adds nothing.
16
+ const HISTORICAL_FEE_CHAINS = new Set([
17
+ chains_1.sepolia.id,
18
+ chains_1.mainnet.id,
19
+ chains_1.plasma.id,
20
+ ]);
12
21
  const DEFAULT_FEE_CONFIG = {
13
22
  historyBlocks: 20, // Geth FullNodeGPO window
14
23
  baseFeeMultiplier: 2n, // ~6 blocks / ~70s headroom (cap only — free)
@@ -30,6 +39,17 @@ const FEE_CONFIG_OVERRIDES = {
30
39
  congestedTipPercentile: 90,
31
40
  tipFloorWei: 0n,
32
41
  },
42
+ // Plasma is here for its broken tip oracle, not a volatile base: base fee ~0
43
+ // and rewards flat at the chain-min (probed 2026-07-06, matching the RHI-4468
44
+ // audit). Floor at the chain-min instead of the 0.1 gwei default — that
45
+ // default is a 20x overpay at this chain's fee scale — so a quiet/empty
46
+ // reward window can't stall a tx while flat markets are never overpaid.
47
+ // Percentiles stay on defaults: the reward distribution is flat in calm
48
+ // markets, so they only bite during real congestion, where the p50→p75
49
+ // escalation is the wanted behavior.
50
+ [chains_1.plasma.id]: {
51
+ tipFloorWei: 5000000n, // 0.005 gwei chain-min priority fee
52
+ },
33
53
  };
34
54
  // Chains where viem's default base-fee estimate is fine but its tip oracle
35
55
  // (eth_maxPriorityFeePerGas) under-prices the priority fee versus the real
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/service-sdk",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Shared SDK for Rhinestone services",
5
5
  "author": {
6
6
  "name": "Rhinestone",