Add Oracle (OracleSet + OracleDelete) transaction workloads#57
Open
manasip-prog wants to merge 3 commits into
Open
Add Oracle (OracleSet + OracleDelete) transaction workloads#57manasip-prog wants to merge 3 commits into
manasip-prog wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OracleSetandOracleDeletetransaction types with valid paths, fault injection, state tracking, and protocol-invariant assertions.OracleSetand the empty-state case is handled by early return in handlers.New files
transactions/oracle.pyparallel_driver_oracle_set_random.shparallel_driver_oracle_delete_random.shModified files
models.pyOracledataclass (account,document_id,provider,asset_class)params.pyapp.pyself.oracles = []toWorkloadstatetransactions/__init__.py_on_oracle_set/_on_oracle_deletestate updaters + registry entriesassertions.pyOracleSet/OracleDeleteto_META_EXPECTATIONStable +OracleDocumentIDto_OBJECT_ID_FIELDStransactions/tickets.pyOracleSetto_TICKET_BUILDERS+OracleDeleteto_TICKET_EXCLUDEDscripts/check-importsoracle_set,oracle_delete,Oracleimportsscripts/check-endpoints/oracle/set/random,/oracle/delete/randomCoverage
Valid paths
w.oraclesand deletes it. Returns silently if none exist.Faulty paths — OracleSet (4 mutations)
non_owner_submissiontefBAD_AUTHinvalid_flags(0x80000000)temINVALID_FLAGinvalid_update_time(epoch + 1)tecINVALID_UPDATE_TIMEprovider_mismatchFaulty paths — OracleDelete (3 mutations)
delete_nonexistenttecNO_ENTRYnon_owner_submissiontefBAD_AUTHinvalid_flags(0x80000000)temINVALID_FLAGAssertions (Always-invariants)
_META_EXPECTATIONS["OracleSet"] = ("Created", "Modified", "Oracle")— ontesSUCCESS, metadata must contain an OracleCreatedNodeorModifiedNode_META_EXPECTATIONS["OracleDelete"] = ("Deleted", "Oracle")— ontesSUCCESS, metadata must contain an OracleDeletedNodeState tracking
_on_oracle_set: Idempotent — updates existing oracle (by account + document_id) or appends newOracletow.oracles_on_oracle_delete: Removes oracle matching account + document_id fromw.oraclesDesign decisions
_random_price_data_series()deduplicates base/quote pairs within a single series and guarantees at least one entry, matching the spec requirement.invalid_update_timeuses epoch + 1 — xrpl-py blocks values before the XRPL epoch (946684800), so we use a value just after the epoch (~year 2000) which passes client validation but triggerstecINVALID_UPDATE_TIMEserver-side (>300s from ledger close).OracleSetis stateless (can create new oracle with any doc_id) so it's in_TICKET_BUILDERS.OracleDeleterequires a pre-existing oracle so it's in_TICKET_EXCLUDED.bytes.fromhex()on these Blob fields, so generators return uppercase hex strings (e.g."chainlink_123"→"636861696E6C696E6B5F313233").Test plan
scripts/check-importspassesscripts/check-endpointspasses (65 endpoints, 29 expected)ruff checkpassesruff format --checkpassesworkload::success : OracleSet✅ reachedworkload::success : OracleDelete✅ reachedworkload::failure : OracleSet✅ reached (faulty paths exercised)workload::seen : OracleSet✅ reachedworkload::endpoint_exception✅ resolved (hex-encoding fix)Known xrpl-py limitations
The following scenarios are blocked by xrpl-py client-side validation before reaching rippled:
PriceDataSeriestemARRAY_EMPTYlen(price_data_series) > 0PriceDataentriestemARRAY_TOO_LARGE/tecARRAY_TOO_LARGElen <= 10LastUpdateTimebefore XRPL epochtemMALFORMED>= 946684800References
Pull Request opened by Augment Code with guidance from the PR author