Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/edb-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const config = {

const MAX_BODY_BYTES = 50 * 1024 * 1024; // 50 MB (artifacts_inline can be large)
const FETCH_TIMEOUT_MS = 120_000; // 2 min for regular requests
const ALLOWED_METHODS = new Set(["GET", "POST", "OPTIONS", "HEAD"]);
const ALLOWED_METHODS = new Set(["GET", "POST", "OPTIONS"]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep HEAD support consistent in EDB proxy

When a client uses HEAD against /api/edb (for example an availability check or metadata probe), this new allowlist rejects it with 405 even though the same handler still advertises HEAD in Access-Control-Allow-Methods and keeps special bodyless handling for HEAD before forwarding. This makes the CORS contract in api/edb-proxy.ts inconsistent with the actual method gate; either keep HEAD here or remove the remaining HEAD handling/header.

Useful? React with 👍 / 👎.


// CORS allowlist — dev servers by default; extend via EDB_CORS_ALLOWED_ORIGINS (comma-separated).
const DEFAULT_ALLOWED_ORIGINS = new Set([
Expand Down
2 changes: 1 addition & 1 deletion api/lifi-composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const config = {

const LIFI_BASE = "https://li.quest";
const LIFI_API_KEY = process.env.LIFI_API_KEY || "";
const ALLOWED_METHODS = new Set(["GET", "OPTIONS", "HEAD"]);
const ALLOWED_METHODS = new Set(["GET", "OPTIONS"]);
const ALLOWED_ORIGINS = new Set(
(process.env.ALLOWED_ORIGINS || "").split(",").filter(Boolean)
);
Expand Down
2 changes: 1 addition & 1 deletion api/lifi-earn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const config = {

const LIFI_EARN_BASE = "https://earn.li.fi";
const LIFI_API_KEY = process.env.LIFI_API_KEY || "";
const ALLOWED_METHODS = new Set(["GET", "OPTIONS", "HEAD"]);
const ALLOWED_METHODS = new Set(["GET", "OPTIONS"]);
const ALLOWED_ORIGINS = new Set(
(process.env.ALLOWED_ORIGINS || "").split(",").filter(Boolean)
);
Expand Down
5 changes: 0 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ export default tseslint.config(
ignores: [
'dist/**',
'node_modules/**',
'current_bundle/**',
'test-results/**',
'scripts/**',
'public/**',
'tests/**',
'test-*/**',
'**/test-*.js',
'test-app-*/**',
'.claude/worktrees/**',
'edb/**',
'starknet-sim/**',
Expand Down
1 change: 0 additions & 1 deletion scripts/bridge-config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const TRACE_DETAIL_GZIP_MIN_BYTES = Number(
);
export const TRACE_STRIP_OPCODE_LINES = process.env.TRACE_DETAIL_STRIP_OPCODE_LINES === "true";
export const TRACE_DETAIL_STRIP_OPCODE_TRACE = process.env.TRACE_DETAIL_STRIP_OPCODE_TRACE !== "false";
export const TRACE_DETAIL_COMPACT_ARTIFACTS = process.env.TRACE_DETAIL_COMPACT_ARTIFACTS !== "false";
export const TRACE_V2_BRIDGE_JS_FALLBACK = process.env.SIM_TRACE_V2_BRIDGE_JS_FALLBACK === "true";
export const TRACE_LITE_TRANSPORT_ENABLED =
process.env.SIM_TRACE_V2_LITE_TRANSPORT !== "false";
Expand Down
16 changes: 0 additions & 16 deletions scripts/bridge-security.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,3 @@ export function redactRpcUrl(url) {
}
}

/**
* Sanitize an object for logging - redacts sensitive fields
* @param {Object} obj
* @returns {Object}
*/
export function sanitizeForLogging(obj) {
if (!obj || typeof obj !== "object") return obj;
const sanitized = { ...obj };
if ("rpcUrl" in sanitized) {
sanitized.rpcUrl = redactRpcUrl(sanitized.rpcUrl);
}
if ("rpc_url" in sanitized) {
sanitized.rpc_url = redactRpcUrl(sanitized.rpc_url);
}
return sanitized;
}
2 changes: 1 addition & 1 deletion src/components/explorer/SlotRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ const InlineInspector: React.FC<InlineInspectorProps> = ({ slot }) => {
Slot Packing Layout
</div>
<div className="bg-muted/10 rounded border border-border/20 p-2">
<PackingVisualizer fields={slot.decodedFields!} rawHex={slot.value} />
<PackingVisualizer fields={slot.decodedFields!} />
</div>
</div>
)}
Expand Down
38 changes: 1 addition & 37 deletions src/components/explorer/SolidityViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,8 @@ export interface SolidityViewerProps {
selectedFile: string | null;
/** Callback when file selection changes */
onFileSelect?: (path: string) => void;
/** Optional: Highlight specific line (1-indexed) */
highlightLine?: number;
/** Optional: Scroll to line on mount/change */
scrollToLine?: number;
/** Optional: Show/hide the built-in file tree sidebar */
showFileTree?: boolean;
/** Optional: Custom theme */
theme?: 'vs-dark' | 'vs-light' | 'hc-black';
/** Optional: Additional CSS class */
className?: string;
/** Optional: Height (default: 100%) */
Expand All @@ -44,15 +38,11 @@ export const SolidityViewer: React.FC<SolidityViewerProps> = ({
files,
selectedFile,
onFileSelect,
highlightLine,
scrollToLine,
showFileTree = true,
theme = 'vs-dark',
className,
height = '100%',
}) => {
const editorRef = useRef<editor.IStandaloneCodeEditor | null>(null);
const decorationsRef = useRef<string[]>([]);
const containerRef = useRef<HTMLDivElement>(null);

// Force Monaco to remount when container becomes visible after display:none toggle.
Expand Down Expand Up @@ -116,32 +106,6 @@ export const SolidityViewer: React.FC<SolidityViewerProps> = ({
setupSolidityMonaco(monaco);
}, []);

useEffect(() => {
if (!editorRef.current || !highlightLine) return;

const editor = editorRef.current;
const monaco = (window as { monaco?: typeof import('monaco-editor') }).monaco;
if (!monaco) return;

decorationsRef.current = editor.deltaDecorations(decorationsRef.current, []);
decorationsRef.current = editor.deltaDecorations([], [
{
range: new monaco.Range(highlightLine, 1, highlightLine, 1),
options: {
isWholeLine: true,
className: 'highlighted-line',
linesDecorationsClassName: 'highlighted-line-gutter',
},
},
]);
}, [highlightLine, currentContent]);

useEffect(() => {
if (!editorRef.current || !scrollToLine) return;

editorRef.current.revealLineInCenter(scrollToLine);
}, [scrollToLine, currentContent]);

const handleFileSelect = useCallback(
(path: string) => {
onFileSelect?.(path);
Expand All @@ -155,7 +119,7 @@ export const SolidityViewer: React.FC<SolidityViewerProps> = ({
height={height}
language={getLanguageFromPath(selectedFile)}
value={currentContent}
theme={theme === 'vs-dark' ? SOLIDITY_THEME_NAME : theme}
theme={SOLIDITY_THEME_NAME}
options={SOLIDITY_EDITOR_OPTIONS}
onMount={handleEditorMount}
loading={
Expand Down
3 changes: 1 addition & 2 deletions src/components/explorer/storage-viewer/PackingVisualizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import type { DecodedSlotField } from '../../../types/debug';

interface PackingVisualizerProps {
fields: DecodedSlotField[];
rawHex?: string;
}

/** Color palette for Solidity types */
Expand Down Expand Up @@ -50,7 +49,7 @@ interface ByteSegment {
isGap: boolean;
}

const PackingVisualizer: React.FC<PackingVisualizerProps> = ({ fields, rawHex }) => {
const PackingVisualizer: React.FC<PackingVisualizerProps> = ({ fields }) => {
/** Build segments for the 32-byte lane */
const segments = useMemo((): ByteSegment[] => {
if (fields.length === 0) return [];
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/debug/structStorageDecoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export async function fillUnreadFieldsFromStorage(
}

const elementType = child.type.replace('[]', '');
const elementSize = elementType === 'address' ? 1 : 1;
const elementSize = 1;
const arrayChildren: DebugVariable[] = [];
const readBatchSize = 8;
for (let start = 0; start < maxElements; start += readBatchSize) {
Expand Down
3 changes: 0 additions & 3 deletions src/utils/edbTraceConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ const parseTraceValue = (value: unknown): ethers.BigNumber | null => {
return null;
}
try {
if (trimmed.startsWith("0x") || trimmed.startsWith("0X")) {
return ethers.BigNumber.from(trimmed);
}
return ethers.BigNumber.from(trimmed);
} catch {
return null;
Expand Down
4 changes: 0 additions & 4 deletions src/utils/storageSlotCalculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,5 @@ export const DIAMOND_NAMESPACES = [
export function parseSlotInput(input: string): bigint {
const trimmed = input.trim();
if (!trimmed) throw new Error('Empty slot input');
if (trimmed.startsWith('0x') || trimmed.startsWith('0X')) {
return BigInt(trimmed);
}
// Try decimal
return BigInt(trimmed);
}