Skip to content

Conversation

@iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented Feb 4, 2025

TL;DR

Added API response serialization and improved field selection in database queries

What changed?

  • Replaced Topics []string with individual topic fields (Topic0, Topic1, Topic2, Topic3) in Log struct
  • Added GetTopic helper method to safely access topic fields
  • Updated log decoding logic to use individual topic fields
  • Added field selection support to database queries for better performance and flexibility
  • Added serialization of blocks, transactions, logs to the API
  • Fixed column name for access_list in transactions table
  • Added new fields to BlockModel for better API documentation
  • Added "deprecated" tag to decodedData field in response and replaced with decoded

How to test?

  1. Run existing log decoding tests to verify topic handling
  2. Test API endpoints with specific field selections
  3. Verify log event decoding with indexed parameters
  4. Check transaction access list functionality
  5. Validate block API responses include new fields

Why make this change?

  • Improved database schema efficiency by using fixed columns instead of arrays
  • Better query performance through selective field fetching
  • Enhanced API response consistency and documentation
  • More reliable log topic handling and event decoding
  • Clearer separation between storage and API models

Copy link
Contributor Author

iuwqyir commented Feb 4, 2025

@iuwqyir iuwqyir changed the title column selection and api serialization olumn selection and api serialization Feb 4, 2025
@iuwqyir iuwqyir changed the title olumn selection and api serialization Specific column selection and api serialization Feb 4, 2025
@iuwqyir iuwqyir requested a review from a team February 4, 2025 16:58
@iuwqyir iuwqyir marked this pull request as ready for review February 4, 2025 16:58
@iuwqyir iuwqyir force-pushed the 02-04-column_selection_and_api_serialization branch 4 times, most recently from 0f3f8ee to 1d57467 Compare February 4, 2025 17:13
@iuwqyir iuwqyir changed the base branch from 02-04-conform_gettraces_to_api_standard to graphite-base/148 February 4, 2025 17:15
@iuwqyir iuwqyir force-pushed the 02-04-column_selection_and_api_serialization branch from 1d57467 to 821f706 Compare February 4, 2025 17:16
@iuwqyir iuwqyir changed the base branch from graphite-base/148 to main February 4, 2025 17:16
@iuwqyir iuwqyir force-pushed the 02-04-column_selection_and_api_serialization branch from 821f706 to c9db79f Compare February 4, 2025 17:16
@iuwqyir iuwqyir force-pushed the 02-04-column_selection_and_api_serialization branch from 4fa7d41 to 2733e5c Compare February 6, 2025 12:34
@iuwqyir iuwqyir merged commit ae78b9d into main Feb 6, 2025
5 checks passed
@iuwqyir iuwqyir deleted the 02-04-column_selection_and_api_serialization branch February 6, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants